()
| 90 | // ============================================================================= |
| 91 | |
| 92 | async function testErrorAsync() { |
| 93 | async function* gen() { |
| 94 | yield [Buffer.from('ok')]; |
| 95 | throw new Error('source failed'); |
| 96 | } |
| 97 | |
| 98 | const readable = toReadable(gen()); |
| 99 | |
| 100 | await assert.rejects(async () => { |
| 101 | // eslint-disable-next-line no-unused-vars |
| 102 | for await (const chunk of readable) { |
| 103 | // Consume until error |
| 104 | } |
| 105 | }, { message: 'source failed' }); |
| 106 | } |
| 107 | |
| 108 | // ============================================================================= |
| 109 | // fromStreamIter: empty source |
no test coverage detected