Skip to content

Commit

Permalink
Test for help for arguments without description (#1459)
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowspawn committed Feb 2, 2021
1 parent 09dfb67 commit a0c1a77
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/command.help.test.js
Expand Up @@ -251,5 +251,15 @@ test('when arguments described then included in helpInformation', () => {
.helpOption(false)
.description('description', { file: 'input source' });
const helpInformation = program.helpInformation();
expect(helpInformation).toMatch(/Arguments:\n +file +input source/); // [sic], extra line
expect(helpInformation).toMatch(/Arguments:\n +file +input source/);
});

test('when arguments described and empty description then arguments included in helpInformation', () => {
const program = new commander.Command();
program
.arguments('<file>')
.helpOption(false)
.description('', { file: 'input source' });
const helpInformation = program.helpInformation();
expect(helpInformation).toMatch(/Arguments:\n +file +input source/);
});

0 comments on commit a0c1a77

Please sign in to comment.