()
| 32 | |
| 33 | // pipeToSync with preventFail: true — source error does NOT call fail() |
| 34 | async 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 |
| 53 | async function testPipeToSyncPreventClose() { |
no test coverage detected