1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-11 00:21:05 -05:00

fix(node): add writable and readable fields to FakeSocket (#19931)

Closes https://github.com/denoland/deno/issues/19927
This commit is contained in:
Bartek Iwańczuk 2023-07-25 09:17:53 +02:00 committed by GitHub
parent 3d35900639
commit bd79baea5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -352,6 +352,8 @@ Deno.test("[node/http] send request with non-chunked body", async () => {
assertEquals(requestBody, "hello world");
});
req.on("socket", (socket) => {
assert(socket.writable);
assert(socket.readable);
socket.setKeepAlive();
socket.destroy();
});

View file

@ -279,6 +279,8 @@ class FakeSocket extends EventEmitter {
this.remoteAddress = opts.hostname;
this.remotePort = opts.port;
this.encrypted = opts.encrypted;
this.writable = true;
this.readable = true;
}
setKeepAlive() {}