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

Function testPerChannelOptions

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

Source from the content-addressed store, hash-verified

87}
88
89async function testPerChannelOptions() {
90 const [channelA, channelB] = duplex({
91 a: { highWaterMark: 1 },
92 b: { highWaterMark: 4 },
93 });
94
95 // Channel A -> B direction uses A's options
96 // Channel B -> A direction uses B's options
97 await channelA.writer.write('from-a');
98 await channelA.close();
99
100 await channelB.writer.write('from-b');
101 await channelB.close();
102
103 const [dataAtA, dataAtB] = await Promise.all([
104 text(channelA.readable),
105 text(channelB.readable),
106 ]);
107
108 assert.strictEqual(dataAtB, 'from-a');
109 assert.strictEqual(dataAtA, 'from-b');
110}
111
112async function testAbortSignal() {
113 const ac = new AbortController();

Callers 1

Calls 5

duplexFunction · 0.85
allMethod · 0.80
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…