Skip to content

Commit a0c1a77

Browse files
authored
Test for help for arguments without description (#1459)
1 parent 09dfb67 commit a0c1a77

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/command.help.test.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -251,5 +251,15 @@ test('when arguments described then included in helpInformation', () => {
251251
.helpOption(false)
252252
.description('description', { file: 'input source' });
253253
const helpInformation = program.helpInformation();
254-
expect(helpInformation).toMatch(/Arguments:\n +file +input source/); // [sic], extra line
254+
expect(helpInformation).toMatch(/Arguments:\n +file +input source/);
255+
});
256+
257+
test('when arguments described and empty description then arguments included in helpInformation', () => {
258+
const program = new commander.Command();
259+
program
260+
.arguments('<file>')
261+
.helpOption(false)
262+
.description('', { file: 'input source' });
263+
const helpInformation = program.helpInformation();
264+
expect(helpInformation).toMatch(/Arguments:\n +file +input source/);
255265
});

0 commit comments

Comments
 (0)