()
| 213 | // ============================================================================= |
| 214 | |
| 215 | async function testShareSourceError() { |
| 216 | async function* failingSource() { |
| 217 | yield [new TextEncoder().encode('a')]; |
| 218 | throw new Error('share source boom'); |
| 219 | } |
| 220 | const shared = share(failingSource()); |
| 221 | const c1 = shared.pull(); |
| 222 | const c2 = shared.pull(); |
| 223 | |
| 224 | await assert.rejects(async () => { |
| 225 | // eslint-disable-next-line no-unused-vars |
| 226 | for await (const _ of c1) { /* consume */ } |
| 227 | }, { message: 'share source boom' }); |
| 228 | await assert.rejects(async () => { |
| 229 | // eslint-disable-next-line no-unused-vars |
| 230 | for await (const _ of c2) { /* consume */ } |
| 231 | }, { message: 'share source boom' }); |
| 232 | } |
| 233 | |
| 234 | async function testShareLateJoiningConsumer() { |
| 235 | // A consumer that joins after some data has been consumed should only |
no test coverage detected