import { describe, it } from 'node:test'; import assert from 'node:assert/strict'; import { execFile } from 'node:child_process'; import { promisify } from 'node:util'; import { fileURLToPath } from 'node:url'; import { join } from 'node:path'; const exec = promisify(execFile); const fixturesDir = join(fileURLToPath(import.meta.url), '..', 'fixtures'); describe('streaming process exit', () => { it('process exits after streaming on dedicated worker', async () => { const { stdout } = await exec( process.execPath, ['--no-warnings', '--experimental-strip-types', join(fixturesDir, 'exit-dedicated-main.ts')], { timeout: 5000 }, ); assert.ok(stdout.includes('DONE')); }); it('process exits after streaming with pool', async () => { const { stdout } = await exec( process.execPath, ['--no-warnings', '--experimental-strip-types', join(fixturesDir, 'exit-pool-main.ts')], { timeout: 5000 }, ); assert.ok(stdout.includes('DONE')); }); });