summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Kettmeir <crowlkats@toaxl.com>2023-07-11 15:08:35 +0200
committerGitHub <noreply@github.com>2023-07-11 15:08:35 +0200
commit9d5f6f67d612bcf6d5edfec3e6a442f499dab9bd (patch)
treedec6569df4570e64a8377b5067468782ec5f048a
parent4cfc54931d765a012b7836e60ba556d9c7b421ff (diff)
fix(node/http): add destroy to FakeSocket (#19796)
Closes #19782
-rw-r--r--cli/tests/unit_node/http_test.ts1
-rw-r--r--ext/node/polyfills/http.ts2
2 files changed, 3 insertions, 0 deletions
diff --git a/cli/tests/unit_node/http_test.ts b/cli/tests/unit_node/http_test.ts
index a84136052..c8c2a52a2 100644
--- a/cli/tests/unit_node/http_test.ts
+++ b/cli/tests/unit_node/http_test.ts
@@ -353,6 +353,7 @@ Deno.test("[node/http] send request with non-chunked body", async () => {
});
req.on("socket", (socket) => {
socket.setKeepAlive();
+ socket.destroy();
});
req.write("hello ");
req.write("world");
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts
index 6a1ea7105..391906c40 100644
--- a/ext/node/polyfills/http.ts
+++ b/ext/node/polyfills/http.ts
@@ -283,6 +283,8 @@ class FakeSocket extends EventEmitter {
setKeepAlive() {}
end() {}
+
+ destroy() {}
}
/** ClientRequest represents the http(s) request from the client */