aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/socket/node-net.test.ts
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-01-31 17:55:16 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-01-31 17:55:16 -0800
commitcc4326cd829decc95d1f1f23998f97705637e04b (patch)
tree9ccaa829b6d48af521d5e5fcdbabc0dac8d186af /test/bun.js/socket/node-net.test.ts
parentc57b37d29f9d04780c7f7917789cf8b424710d23 (diff)
downloadbun-cc4326cd829decc95d1f1f23998f97705637e04b.tar.gz
bun-cc4326cd829decc95d1f1f23998f97705637e04b.tar.zst
bun-cc4326cd829decc95d1f1f23998f97705637e04b.zip
Re-run prettier after changes
Diffstat (limited to 'test/bun.js/socket/node-net.test.ts')
-rw-r--r--test/bun.js/socket/node-net.test.ts24
1 files changed, 8 insertions, 16 deletions
diff --git a/test/bun.js/socket/node-net.test.ts b/test/bun.js/socket/node-net.test.ts
index 3a6749533..e6c17d931 100644
--- a/test/bun.js/socket/node-net.test.ts
+++ b/test/bun.js/socket/node-net.test.ts
@@ -1,12 +1,4 @@
-import {
- afterAll,
- afterEach,
- beforeAll,
- beforeEach,
- describe,
- expect,
- it,
-} from "bun:test";
+import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it } from "bun:test";
import { connect, isIP, isIPv4, isIPv6, Socket } from "net";
it("should support net.isIP()", () => {
@@ -41,7 +33,7 @@ describe("net.Socket read", () => {
]) {
describe(label, () => {
function runWithServer(cb) {
- return (done) => {
+ return done => {
function drain(socket) {
const message = socket.data.message;
const written = socket.write(message);
@@ -94,7 +86,7 @@ describe("net.Socket read", () => {
expect(socket.connecting).toBe(false);
})
.setEncoding("utf8")
- .on("data", (chunk) => {
+ .on("data", chunk => {
data += chunk;
})
.on("end", () => {
@@ -120,7 +112,7 @@ describe("net.Socket read", () => {
expect(socket.connecting).toBe(false);
})
.setEncoding("utf8")
- .on("data", (chunk) => {
+ .on("data", chunk => {
data += chunk;
})
.on("end", () => {
@@ -146,7 +138,7 @@ describe("net.Socket read", () => {
expect(socket.connecting).toBe(false);
})
.setEncoding("utf8")
- .on("data", (chunk) => {
+ .on("data", chunk => {
data += chunk;
})
.on("end", () => {
@@ -169,7 +161,7 @@ describe("net.Socket write", () => {
let port = 53213;
function runWithServer(cb) {
- return (done) => {
+ return done => {
let server;
function close(socket) {
@@ -263,11 +255,11 @@ describe("net.Socket write", () => {
);
});
-it("should handle connection error", (done) => {
+it("should handle connection error", done => {
var data = {};
connect(55555, () => {
done(new Error("Should not have connected"));
- }).on("error", (error) => {
+ }).on("error", error => {
expect(error).toBeDefined();
expect(error.name).toBe("SystemError");
expect(error.message).toBe("Failed to connect");