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

Function testChannelFail

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

Source from the content-addressed store, hash-verified

143
144// Channel fail propagation
145async function testChannelFail() {
146 const [a, b] = duplex();
147 a.writer.fail(new Error('channel failed'));
148 await assert.rejects(async () => {
149 // eslint-disable-next-line no-unused-vars
150 for await (const _ of b.readable) { /* consume */ }
151 }, { message: 'channel failed' });
152 await b.close();
153}
154
155// Abort signal affects both channels
156async function testAbortSignalBothChannels() {

Callers 1

Calls 3

duplexFunction · 0.85
closeMethod · 0.65
failMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…