summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/tests/unit_node/http_test.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/cli/tests/unit_node/http_test.ts b/cli/tests/unit_node/http_test.ts
index ae708c343..c46a3de41 100644
--- a/cli/tests/unit_node/http_test.ts
+++ b/cli/tests/unit_node/http_test.ts
@@ -482,6 +482,26 @@ Deno.test("[node/http] ServerResponse _implicitHeader", async () => {
await promise;
});
+// https://github.com/denoland/deno/issues/21509
+Deno.test("[node/http] ServerResponse flushHeaders", async () => {
+ const { promise, resolve } = Promise.withResolvers<void>();
+ const server = http.createServer((_req, res) => {
+ res.flushHeaders(); // no-op
+ res.end("Hello World");
+ });
+
+ server.listen(async () => {
+ const { port } = server.address() as { port: number };
+ const res = await fetch(`http://localhost:${port}`);
+ assertEquals(await res.text(), "Hello World");
+ server.close(() => {
+ resolve();
+ });
+ });
+
+ await promise;
+});
+
Deno.test("[node/http] server unref", async () => {
const [statusCode, _output] = await execCode(`
import http from "node:http";