()
| 68 | |
| 69 | // PipeToSync source error calls writer.fail() |
| 70 | async 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 |
| 88 | async function testPipeToWithSignal() { |
no test coverage detected
searching dependent graphs…