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

Function testPipeToSyncSourceError

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

Source from the content-addressed store, hash-verified

68
69// PipeToSync source error calls writer.fail()
70async function testPipeToSyncSourceError() {
71 let failCalled = false;
72 const writer = {
73 writeSync() { return true; },
74 fail(reason) { failCalled = true; },
75 };
76 function* failingSource() {
77 yield [new TextEncoder().encode('a')];
78 throw new Error('sync pipe boom');
79 }
80 assert.throws(
81 () => pipeToSync(failingSource(), writer),
82 { message: 'sync pipe boom' },
83 );
84 assert.strictEqual(failCalled, true);
85}
86
87// PipeTo with AbortSignal
88async function testPipeToWithSignal() {

Callers 1

Calls 2

pipeToSyncFunction · 0.85
failingSourceFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…