summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/tests/unit_node/http_test.ts21
1 files changed, 21 insertions, 0 deletions
diff --git a/cli/tests/unit_node/http_test.ts b/cli/tests/unit_node/http_test.ts
index 5285d8e23..72525d803 100644
--- a/cli/tests/unit_node/http_test.ts
+++ b/cli/tests/unit_node/http_test.ts
@@ -584,6 +584,27 @@ Deno.test("[node/http] ClientRequest setTimeout", async () => {
assertEquals(body, "HTTP/1.1");
});
+Deno.test("[node/http] ClientRequest setNoDelay", async () => {
+ let body = "";
+ const { promise, resolve, reject } = Promise.withResolvers<void>();
+ const timer = setTimeout(() => reject("timed out"), 50000);
+ const req = http.request("http://localhost:4545/http_version", (resp) => {
+ resp.on("data", (chunk) => {
+ body += chunk;
+ });
+
+ resp.on("end", () => {
+ resolve();
+ });
+ });
+ req.setNoDelay(true);
+ req.once("error", (e) => reject(e));
+ req.end();
+ await promise;
+ clearTimeout(timer);
+ assertEquals(body, "HTTP/1.1");
+});
+
Deno.test("[node/http] ClientRequest PATCH", async () => {
let body = "";
const { promise, resolve, reject } = Promise.withResolvers<void>();