Skip to content

Commit

Permalink
Add test for edge case in argumentDescription
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowspawn committed May 25, 2021
1 parent c31862b commit b47afa5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/help.argumentDescription.test.js
Expand Up @@ -27,4 +27,10 @@ describe('argumentDescription', () => {
const helper = new commander.Help();
expect(helper.argumentDescription(argument)).toEqual('description (default: custom)');
});

test('when an argument has default value and no description then still return default value', () => {
const argument = new commander.Argument('[n]').default('default');
const helper = new commander.Help();
expect(helper.argumentDescription(argument)).toEqual('(default: "default")');
});
});

0 comments on commit b47afa5

Please sign in to comment.