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

Function testPipeToSyncPreventFail

test/parallel/test-stream-iter-pipeto-edge.js:34–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32
33// pipeToSync with preventFail: true — source error does NOT call fail()
34async function testPipeToSyncPreventFail() {
35 let failCalled = false;
36 const writer = {
37 writeSync() { return true; },
38 endSync() { return 0; },
39 fail() { failCalled = true; },
40 };
41 function* badSource() {
42 yield [new Uint8Array([1])];
43 throw new Error('source error');
44 }
45 assert.throws(
46 () => pipeToSync(badSource(), writer, { preventFail: true }),
47 { message: 'source error' },
48 );
49 assert.strictEqual(failCalled, false);
50}
51
52// pipeToSync with preventClose: true — end/endSync not called
53async function testPipeToSyncPreventClose() {

Callers 1

Calls 2

pipeToSyncFunction · 0.85
badSourceFunction · 0.70

Tested by

no test coverage detected