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

Function testChannelClose

test/parallel/test-stream-iter-duplex.js:60–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58}
59
60async function testChannelClose() {
61 const [channelA, channelB] = duplex();
62
63 await channelA.close();
64
65 // Should be able to close twice without error
66 await channelA.close();
67
68 // B's readable should end (A -> B direction is closed)
69 const batches = [];
70 for await (const batch of channelB.readable) {
71 batches.push(batch);
72 }
73 assert.strictEqual(batches.length, 0);
74}
75
76async function testWithOptions() {
77 const [channelA, channelB] = duplex({

Callers 1

Calls 3

duplexFunction · 0.85
closeMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…