| 3 | import { spawnSyncAndExitWithoutError } from '../common/child_process.js'; |
| 4 | |
| 5 | async function runTests(run, reporters) { |
| 6 | for (const reporterName of Object.keys(reporters)) { |
| 7 | if (reporterName === 'default') continue; |
| 8 | console.log({ reporterName }); |
| 9 | |
| 10 | const stream = run({ |
| 11 | files: undefined |
| 12 | }).compose(reporters[reporterName]); |
| 13 | stream.on('test:fail', () => { |
| 14 | throw new Error('Received test:fail with ' + reporterName); |
| 15 | }); |
| 16 | stream.on('test:pass', () => { |
| 17 | throw new Error('Received test:pass with ' + reporterName); |
| 18 | }); |
| 19 | |
| 20 | // eslint-disable-next-line no-unused-vars |
| 21 | for await (const _ of stream); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | tmpdir.refresh(); |
| 26 | spawnSyncAndExitWithoutError(process.execPath, ['--input-type=module', '-e', ` |