(t)
| 6 | |
| 7 | describe('Option.conflicts()', () => { |
| 8 | function makeProgram(t) { |
| 9 | const actionMock = t.mock.fn(); |
| 10 | const program = createTestCommand(); |
| 11 | program |
| 12 | .command('foo') |
| 13 | .addOption( |
| 14 | new commander.Option('-s, --silent', "Don't print anything").env( |
| 15 | 'SILENT', |
| 16 | ), |
| 17 | ) |
| 18 | .addOption( |
| 19 | new commander.Option('-j, --json', 'Format output as json') |
| 20 | .env('JSON') |
| 21 | .conflicts(['silent']), |
| 22 | ) |
| 23 | .action(actionMock); |
| 24 | |
| 25 | return { program, actionMock }; |
| 26 | } |
| 27 | |
| 28 | test.beforeEach(() => { |
| 29 | delete process.env.SILENT; |
no test coverage detected