(args: string[])
| 128 | } |
| 129 | |
| 130 | function run(args: string[]): Child { |
| 131 | const child = spawn(process.execPath, args, { |
| 132 | stdio: ['pipe', 'pipe', 'ignore'], |
| 133 | // Off the fixture, so a child still exiting cannot hold it (Windows EBUSY). |
| 134 | cwd: os.tmpdir(), |
| 135 | windowsHide: true, |
| 136 | }); |
| 137 | let out = ''; |
| 138 | child.stdout!.on('data', (chunk) => { out += String(chunk); }); |
| 139 | const exited = new Promise<number | null>((resolve) => child.once('exit', (code) => resolve(code))); |
| 140 | const handle = { child, output: () => out, exited }; |
| 141 | children.push(handle); |
| 142 | return handle; |
| 143 | } |
| 144 | |
| 145 | async function says(who: Child, word: string): Promise<void> { |
| 146 | const deadline = Date.now() + 30_000; |
no test coverage detected