()
| 457 | // ============================================================================= |
| 458 | |
| 459 | async function testErrorSync() { |
| 460 | function* gen() { |
| 461 | yield [Buffer.from('ok')]; |
| 462 | throw new Error('sync source failed'); |
| 463 | } |
| 464 | |
| 465 | const readable = toReadableSync(gen()); |
| 466 | |
| 467 | await assert.rejects(async () => { |
| 468 | // eslint-disable-next-line no-unused-vars |
| 469 | for await (const chunk of readable) { |
| 470 | // Consume until error |
| 471 | } |
| 472 | }, { message: 'sync source failed' }); |
| 473 | } |
| 474 | |
| 475 | // ============================================================================= |
| 476 | // fromStreamIterSync: empty source |
no test coverage detected