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

Function testPipeToPreventFail

test/parallel/test-stream-iter-pipeto.js:192–207  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

190
191// PipeTo preventFail option
192async function testPipeToPreventFail() {
193 let failCalled = false;
194 const writer = {
195 write() {},
196 fail() { failCalled = true; },
197 };
198 // eslint-disable-next-line require-yield
199 async function* failingSource() {
200 throw new Error('boom');
201 }
202 await assert.rejects(
203 () => pipeTo(failingSource(), writer, { preventFail: true }),
204 { message: 'boom' },
205 );
206 assert.strictEqual(failCalled, false);
207}
208
209// PipeToSync preventClose option
210async function testPipeToSyncPreventClose() {

Callers 1

Calls 2

pipeToFunction · 0.85
failingSourceFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…