Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: cover BYOB Readable.toWeb termination
  • Loading branch information
ikeyan committed Mar 23, 2026
commit cacf709e3de0cb4266989b0f167515885d0edc48
21 changes: 21 additions & 0 deletions test/parallel/test-whatwg-webstreams-adapters-to-readablestream.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,27 @@ const {
})().then(common.mustCall());
}

{
const readable = new PassThrough();
const readableStream = newReadableStreamFromStreamReadable(readable, {
type: 'bytes',
});
const reader = readableStream.getReader({ mode: 'byob' });

(async () => {
const readPromise = reader.read(new Uint8Array(8));

readable.end();
await once(readable, 'end');

assert.deepStrictEqual(await readPromise, {
value: new Uint8Array(0),
done: true,
});
await reader.closed;
})().then(common.mustCall());
}

{
const duplex = new Duplex({ readable: false });
duplex.destroy();
Expand Down
Loading