(t)
| 29 | |
| 30 | describe('default action command', () => { |
| 31 | function makeProgram(t) { |
| 32 | const program = new commander.Command(); |
| 33 | const actionMock = t.mock.fn(); |
| 34 | program.command('other'); |
| 35 | program |
| 36 | .command('default', { isDefault: true }) |
| 37 | .allowUnknownOption() |
| 38 | .allowExcessArguments() |
| 39 | .action(actionMock); |
| 40 | return { program, actionMock }; |
| 41 | } |
| 42 | |
| 43 | test('when default subcommand and no command then call default', (t) => { |
| 44 | const { program, actionMock } = makeProgram(t); |
no test coverage detected