MCPcopy Index your code
hub / github.com/nodejs/node / testWriterEnd

Function testWriterEnd

test/parallel/test-stream-iter-push-basic.js:45–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43}
44
45async function testWriterEnd() {
46 const { writer, readable } = push();
47
48 const totalBytes = writer.endSync();
49 assert.strictEqual(totalBytes, 0);
50
51 // Calling endSync again returns byte count (idempotent when closed)
52 assert.strictEqual(writer.endSync(), 0);
53
54 const batches = [];
55 for await (const batch of readable) {
56 batches.push(batch);
57 }
58 assert.strictEqual(batches.length, 0);
59}
60
61async function testWriterFail() {
62 const { writer, readable } = push();

Callers 1

Calls 3

pushFunction · 0.70
endSyncMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…