Skip to content
Myr

Increase test coverage (#1381)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Test passing parameter to allowUnknownOptions * Test negated option in help

authored by John Gee · committed by GitHub · parent b1d984b · Browse files · 2 files+34 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+34 added−1 removed

  • tests:+34 added−1 removed

2 files+34 added−1 removed

modified:tests/command.allowUnknownOptions.test.js+25 added-1 removed
modified:tests/command.help.test.js+9 added
161 unmodified lines
162 const helpInformation = program.helpInformation();163 expect(helpInformation).not.toMatch('Options');164});165166test('when negated option then option included in helpInformation', () => {167 const program = new commander.Command();168 program169 .option('-C, --no-colour', 'colourless');170 const helpInformation = program.helpInformation();171 expect(helpInformation).toMatch('--no-colour');172 expect(helpInformation).toMatch('colourless');173});174175test('when option.hideHelp() then option not included in helpInformation', () => {176 const program = new commander.Command();177 program178 .addOption(new commander.Option('-s,--secret', 'secret option').hideHelp());
70 unmodified lines