summaryrefslogtreecommitdiff
path: root/cli/tests/unit/fetch_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/fetch_test.ts')
-rw-r--r--cli/tests/unit/fetch_test.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts
index 285e05a7d..a01b09d13 100644
--- a/cli/tests/unit/fetch_test.ts
+++ b/cli/tests/unit/fetch_test.ts
@@ -1047,9 +1047,13 @@ unitTest(
const buf = bufferServer(addr);
const stream = new TransformStream();
const writer = stream.writable.getWriter();
- await writer.write(new TextEncoder().encode("hello "));
- await writer.write(new TextEncoder().encode("world"));
- await writer.close();
+ // transformer writes don't resolve until they are read, so awaiting these
+ // will cause the transformer to hang, as the suspend the transformer, it
+ // is also illogical to await for the reads, as that is the whole point of
+ // streams is to have a "queue" which gets drained...
+ writer.write(new TextEncoder().encode("hello "));
+ writer.write(new TextEncoder().encode("world"));
+ writer.close();
const response = await fetch(`http://${addr}/blah`, {
method: "POST",
headers: [