Skip to content

Commit 0cf2b5d

Browse files
committed
Add test for variadic argument usage/help
1 parent 3b42537 commit 0cf2b5d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/args.variadic.test.js

+9
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,13 @@ describe('variadic argument', () => {
6868
program.command('sub <variadicArg...> [optionalArg]');
6969
}).toThrow("only the last argument can be variadic 'variadicArg'");
7070
});
71+
72+
test('when variadic argument then usage shows variadic', () => {
73+
const program = new commander.Command();
74+
program
75+
.name('foo')
76+
.arguments('[args...]');
77+
78+
expect(program.usage()).toBe('[options] [args...]');
79+
});
7180
});

0 commit comments

Comments
 (0)