mirror of
https://github.com/denoland/deno.git
synced 2024-12-12 02:27:46 -05:00
enable another destroy test case with some modification
This commit is contained in:
parent
7a912bfda3
commit
15910606e4
1 changed files with 7 additions and 4 deletions
|
@ -1020,13 +1020,16 @@ Deno.test(
|
||||||
|
|
||||||
Deno.test(
|
Deno.test(
|
||||||
"[node/http] client destroy before sending request should not error",
|
"[node/http] client destroy before sending request should not error",
|
||||||
{
|
async () => {
|
||||||
ignore: true,
|
const { resolve, promise } = Promise.withResolvers<void>();
|
||||||
},
|
|
||||||
() => {
|
|
||||||
const request = http.request("http://localhost:5929/");
|
const request = http.request("http://localhost:5929/");
|
||||||
// Calling this would throw
|
// Calling this would throw
|
||||||
request.destroy();
|
request.destroy();
|
||||||
|
request.on("error", (e) => {
|
||||||
|
assertEquals(e.message, "socket hang up");
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
await promise;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue