diff options
Diffstat (limited to 'cli/tests/unit_node')
-rw-r--r-- | cli/tests/unit_node/http_test.ts | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/cli/tests/unit_node/http_test.ts b/cli/tests/unit_node/http_test.ts index 556ba1684..08d2626d7 100644 --- a/cli/tests/unit_node/http_test.ts +++ b/cli/tests/unit_node/http_test.ts @@ -185,6 +185,7 @@ Deno.test("[node/http] server can respond with 101, 204, 205, 304 status", async Deno.test("[node/http] request default protocol", async () => { const promise = deferred<void>(); + const promise2 = deferred<void>(); const server = http.createServer((_, res) => { res.end("ok"); }); @@ -198,6 +199,7 @@ Deno.test("[node/http] request default protocol", async () => { server.close(); }); assertEquals(res.statusCode, 200); + promise2.resolve(); }, ); req.end(); @@ -206,6 +208,7 @@ Deno.test("[node/http] request default protocol", async () => { promise.resolve(); }); await promise; + await promise2; }); Deno.test("[node/http] request with headers", async () => { @@ -292,32 +295,6 @@ Deno.test("[node/http] http.IncomingMessage can be created without url", () => { }); */ -Deno.test("[node/http] set http.IncomingMessage.statusMessage", () => { - // deno-lint-ignore no-explicit-any - const message = new (http as any).IncomingMessageForClient( - new Response(null, { status: 404, statusText: "Not Found" }), - { - encrypted: true, - readable: false, - remoteAddress: "foo", - address() { - return { port: 443, family: "IPv4" }; - }, - // deno-lint-ignore no-explicit-any - end(_cb: any) { - return this; - }, - // deno-lint-ignore no-explicit-any - destroy(_e: any) { - return; - }, - }, - ); - assertEquals(message.statusMessage, "Not Found"); - message.statusMessage = "boom"; - assertEquals(message.statusMessage, "boom"); -}); - Deno.test("[node/http] send request with non-chunked body", async () => { let requestHeaders: Headers; let requestBody = ""; |