()
| 48 | |
| 49 | // PipeTo source error calls writer.fail() |
| 50 | async 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() |
| 70 | async function testPipeToSyncSourceError() { |
no test coverage detected
searching dependent graphs…