(argv: string[])
| 5 | import { OptionConflictError, validateOptions } from '#/cli/options'; |
| 6 | |
| 7 | function parse(argv: string[]): CLIOptions { |
| 8 | let captured: CLIOptions | undefined; |
| 9 | const program = createProgram( |
| 10 | '0.0.0-test', |
| 11 | (opts) => { |
| 12 | captured = opts; |
| 13 | }, |
| 14 | () => {}, |
| 15 | ); |
| 16 | program.exitOverride(); |
| 17 | program.configureOutput({ |
| 18 | writeOut: () => {}, |
| 19 | writeErr: () => {}, |
| 20 | }); |
| 21 | program.parse(['node', 'kimi', ...argv]); |
| 22 | if (captured === undefined) { |
| 23 | throw new Error('Main action handler was not called'); |
| 24 | } |
| 25 | return captured; |
| 26 | } |
| 27 | |
| 28 | describe('--session / -r / -S picker routing', () => { |
| 29 | describe('argParser: no-arg forms coerce to empty string', () => { |
no test coverage detected