()
| 125 | // ============================================================================= |
| 126 | |
| 127 | function testShareSyncSourceError() { |
| 128 | function* failingSource() { |
| 129 | yield [new TextEncoder().encode('ok')]; |
| 130 | throw new Error('sync share boom'); |
| 131 | } |
| 132 | const shared = shareSync(failingSource()); |
| 133 | const c1 = shared.pull(); |
| 134 | const c2 = shared.pull(); |
| 135 | |
| 136 | // Both consumers should see the error |
| 137 | assert.throws(() => { |
| 138 | // eslint-disable-next-line no-unused-vars |
| 139 | for (const _ of c1) { /* consume */ } |
| 140 | }, { message: 'sync share boom' }); |
| 141 | assert.throws(() => { |
| 142 | // eslint-disable-next-line no-unused-vars |
| 143 | for (const _ of c2) { /* consume */ } |
| 144 | }, { message: 'sync share boom' }); |
| 145 | } |
| 146 | |
| 147 | // shareSync() accepts string source directly (normalized via fromSync()) |
| 148 | function testShareSyncStringSource() { |
no test coverage detected