summaryrefslogtreecommitdiff
path: root/cli/tests/unit/flash_test.ts
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-09-28 11:52:24 -0700
committerGitHub <noreply@github.com>2022-09-28 20:52:24 +0200
commite2828ad762034a0e8d38387d4e5d38cafa409f13 (patch)
tree8c3996bdf75900fcfe8bd62d074c25c3797c3207 /cli/tests/unit/flash_test.ts
parentfcb20ab952fb78cd3069239a25f8e24d49cca541 (diff)
fix(ext/flash): reregister socket on partial read on Windows (#16076)
Diffstat (limited to 'cli/tests/unit/flash_test.ts')
-rw-r--r--cli/tests/unit/flash_test.ts29
1 files changed, 29 insertions, 0 deletions
diff --git a/cli/tests/unit/flash_test.ts b/cli/tests/unit/flash_test.ts
index 087e5d0f2..a2011a076 100644
--- a/cli/tests/unit/flash_test.ts
+++ b/cli/tests/unit/flash_test.ts
@@ -2205,6 +2205,35 @@ Deno.test(
},
);
+// https://github.com/denoland/deno/issues/15549
+Deno.test(
+ { permissions: { net: true } },
+ async function testIssue15549() {
+ const ac = new AbortController();
+ const promise = deferred();
+ let count = 0;
+ const server = Deno.serve(() => {
+ count++;
+ return new Response(`hello world ${count}`);
+ }, {
+ async onListen() {
+ const res1 = await fetch("http://localhost:9000/");
+ assertEquals(await res1.text(), "hello world 1");
+
+ const res2 = await fetch("http://localhost:9000/");
+ assertEquals(await res2.text(), "hello world 2");
+
+ promise.resolve();
+ ac.abort();
+ },
+ signal: ac.signal,
+ });
+
+ await promise;
+ await server;
+ },
+);
+
function chunkedBodyReader(h: Headers, r: BufReader): Deno.Reader {
// Based on https://tools.ietf.org/html/rfc2616#section-19.4.6
const tp = new TextProtoReader(r);