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

Function testPipeToSourceError

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

Source from the content-addressed store, hash-verified

48
49// PipeTo source error calls writer.fail()
50async function testPipeToSourceError() {
51 let failCalled = false;
52 let failReason;
53 const writer = {
54 write() {},
55 fail(reason) { failCalled = true; failReason = reason; },
56 };
57 async function* failingSource() {
58 yield [new TextEncoder().encode('a')];
59 throw new Error('pipe source boom');
60 }
61 await assert.rejects(
62 () => pipeTo(failingSource(), writer),
63 { message: 'pipe source boom' },
64 );
65 assert.strictEqual(failCalled, true);
66 assert.strictEqual(failReason.message, 'pipe source boom');
67}
68
69// PipeToSync source error calls writer.fail()
70async function testPipeToSyncSourceError() {

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…