mirror of
https://github.com/denoland/deno.git
synced 2025-07-24 13:44:08 +00:00
parent
2d1208556a
commit
b8303c7812
13 changed files with 3225 additions and 3678 deletions
|
@ -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: [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue