1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-03 17:08:35 -05:00

enable another destroy test case with some modification

This commit is contained in:
Yoshiya Hinosawa 2024-09-26 19:22:46 +09:00
parent 7a912bfda3
commit 15910606e4
No known key found for this signature in database
GPG key ID: 9017DB4559488785

View file

@ -1020,13 +1020,16 @@ Deno.test(
Deno.test(
"[node/http] client destroy before sending request should not error",
{
ignore: true,
},
() => {
async () => {
const { resolve, promise } = Promise.withResolvers<void>();
const request = http.request("http://localhost:5929/");
// Calling this would throw
request.destroy();
request.on("error", (e) => {
assertEquals(e.message, "socket hang up");
resolve();
});
await promise;
},
);