Skip to content

Commit

Permalink
refactor(op_crate/fetch): align streams to spec (#9103)
Browse files Browse the repository at this point in the history
Fixes #8814
  • Loading branch information
kitsonk authored Jan 14, 2021
1 parent 2d12085 commit b8303c7
Show file tree
Hide file tree
Showing 13 changed files with 3,373 additions and 3,826 deletions.
10 changes: 7 additions & 3 deletions cli/tests/unit/fetch_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
72 changes: 0 additions & 72 deletions cli/tests/unit/streams_internal_test.ts

This file was deleted.

131 changes: 0 additions & 131 deletions cli/tests/unit/streams_piping_test.ts

This file was deleted.

Loading

0 comments on commit b8303c7

Please sign in to comment.