(command: string)
| 346 | const opts: Opts = { armed: false } |
| 347 | const s = stubs(on, opts) |
| 348 | const tryCommand = async (command: string) => { |
| 349 | opts.armed = false |
| 350 | await $.session.start({ cwd: '/work/demo' }) |
| 351 | await usePad($, 'pad bootstrap') // the first use: not armed |
| 352 | opts.armed = true // consent exists by the time the command returns |
| 353 | await usePad($, command) |
| 354 | await settle() |
| 355 | const started = s.spawns.length |
| 356 | // an end that stops the stream resets wake and the stream |
| 357 | await $.session.end({ reason: 'prompt_input_exit' }) |
| 358 | s.spawns.length = 0 |
| 359 | s.runs.length = 0 |
| 360 | return [command, started] |
| 361 | } |
| 362 | for (const command of ARMS) expect(await tryCommand(command)).toEqual([command, 1]) |
| 363 | for (const command of NOT_ARMS) expect(await tryCommand(command)).toEqual([command, 0]) |
| 364 | }) |
no test coverage detected