1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-12 02:27:46 -05:00
This commit is contained in:
Yoshiya Hinosawa 2024-09-26 19:10:41 +09:00
parent 2c60a4352d
commit 7c43c3c988
No known key found for this signature in database
GPG key ID: 9017DB4559488785

View file

@ -1030,15 +1030,16 @@ Deno.test(
}, },
); );
Deno.test("[node/http] destroyed requests should not be sent", { Deno.test(
ignore: true, "[node/http] destroyed requests should not be sent",
}, async () => { { ignore: true },
async () => {
let receivedRequest = false; let receivedRequest = false;
const server = Deno.serve(() => { const server = Deno.serve(() => {
receivedRequest = true; receivedRequest = true;
return new Response(null); return new Response(null);
}); });
let receivedError = null let receivedError = null;
const request = http.request(`http://localhost:${server.addr.port}/`); const request = http.request(`http://localhost:${server.addr.port}/`);
request.destroy(); request.destroy();
request.end("hello"); request.end("hello");
@ -1049,7 +1050,8 @@ Deno.test("[node/http] destroyed requests should not be sent", {
assert(receivedError!.toString().contains("socket hung up")); assert(receivedError!.toString().contains("socket hung up"));
assertEquals(receivedRequest, false); assertEquals(receivedRequest, false);
await server.shutdown(); await server.shutdown();
}); },
);
Deno.test("[node/http] node:http exports globalAgent", async () => { Deno.test("[node/http] node:http exports globalAgent", async () => {
const http = await import("node:http"); const http = await import("node:http");
@ -1358,7 +1360,12 @@ Deno.test("[node/http] client closing a streaming response doesn't terminate ser
clearInterval(interval!); clearInterval(interval!);
}); });
Deno.test("[node/http] client closing a streaming request doesn't terminate server", { ignore: true }, async () => { Deno.test(
"[node/http] client closing a streaming request doesn't terminate server",
{
ignore: true,
},
async () => {
let interval: number; let interval: number;
let uploadedData = ""; let uploadedData = "";
let requestError: Error | null = null; let requestError: Error | null = null;
@ -1436,7 +1443,8 @@ Deno.test("[node/http] client closing a streaming request doesn't terminate serv
server.close(); server.close();
assertEquals(server.listening, false); assertEquals(server.listening, false);
clearInterval(interval!); clearInterval(interval!);
}); },
);
Deno.test("[node/http] http.request() post streaming body works", { Deno.test("[node/http] http.request() post streaming body works", {
ignore: true, ignore: true,