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

Function testMultipleWrites

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

Source from the content-addressed store, hash-verified

46}
47
48async function testMultipleWrites() {
49 const [channelA, channelB] = duplex({ highWaterMark: 10 });
50
51 await channelA.writer.write('one');
52 await channelA.writer.write('two');
53 await channelA.writer.write('three');
54 await channelA.close();
55
56 const data = await text(channelB.readable);
57 assert.strictEqual(data, 'onetwothree');
58}
59
60async function testChannelClose() {
61 const [channelA, channelB] = duplex();

Callers 1

Calls 4

duplexFunction · 0.85
closeMethod · 0.65
textFunction · 0.50
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…