| 19 | let testResults; |
| 20 | |
| 21 | async function main({ n, reporter: r }) { |
| 22 | testResults ??= await stream.toArray(); |
| 23 | |
| 24 | // Create readable streams for each iteration |
| 25 | const readables = Array.from({ length: n }, () => Readable.from(testResults)); |
| 26 | |
| 27 | // Get the selected reporter |
| 28 | const reporter = reporters[r]; |
| 29 | |
| 30 | bench.start(); |
| 31 | |
| 32 | let noDead; |
| 33 | for (const readable of readables) { |
| 34 | // Process each readable stream through the reporter |
| 35 | noDead = await readable.compose(reporter).toArray(); |
| 36 | } |
| 37 | |
| 38 | bench.end(n); |
| 39 | |
| 40 | assert.ok(noDead); |
| 41 | } |