From cf8b7bb53061ded139626378cf73c7b05f747eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 29 May 2023 01:29:01 +0200 Subject: fix(node): http.IncomingMessageForClient.complete (#19302) Closes https://github.com/denoland/deno/issues/19238 --- cli/tests/unit_node/http_test.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cli') diff --git a/cli/tests/unit_node/http_test.ts b/cli/tests/unit_node/http_test.ts index 55160855e..5eb8c15bd 100644 --- a/cli/tests/unit_node/http_test.ts +++ b/cli/tests/unit_node/http_test.ts @@ -190,15 +190,21 @@ Deno.test("[node/http] request default protocol", async () => { const server = http.createServer((_, res) => { res.end("ok"); }); + + // @ts-ignore IncomingMessageForClient + // deno-lint-ignore no-explicit-any + let clientRes: any; server.listen(() => { const req = http.request( // deno-lint-ignore no-explicit-any { host: "localhost", port: (server.address() as any).port }, (res) => { + assertEquals(res.complete, false); res.on("data", () => {}); res.on("end", () => { server.close(); }); + clientRes = res; assertEquals(res.statusCode, 200); promise2.resolve(); }, @@ -210,6 +216,7 @@ Deno.test("[node/http] request default protocol", async () => { }); await promise; await promise2; + assertEquals(clientRes!.complete, true); }); Deno.test("[node/http] request with headers", async () => { -- cgit v1.2.3