Skip to content

Commit 991dfbf

Browse files
committed
test: handle negative --wait consistently
commander 14 treats negative numbers as option arguments rather than as options due to <tj/commander.js#2339>. Test that negative arguments for --wait are handled consistently. Signed-off-by: Kevin Locke <[email protected]>
1 parent a6b6655 commit 991dfbf

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

test/cli.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,8 @@ describe('hub-ci-status command', () => {
291291
expectArgsErr(['--wait=-1'], /\bwait\b/);
292292
expectArgsErr(['-wnope'], /\bwait\b/);
293293
expectArgsErr(['-w-1'], /\bwait\b/);
294-
// Note: commander treats negative values for optional arguments as unknown
295-
// https://github.com/tj/commander.js/issues/61
296-
// https://github.com/tj/commander.js/pull/583#issuecomment-486819992
297-
expectArgsErr(['--wait', '-1'], /\bunknown option\b/);
298-
expectArgsErr(['-w', '-1'], /\bunknown option\b/);
294+
expectArgsErr(['--wait', '-1'], /\bwait\b/);
295+
expectArgsErr(['-w', '-1'], /\bwait\b/);
299296
expectArgsErr(['--unknown123'], /\bunknown123\b/);
300297
// Note: Differs from hub(1), which ignores unexpected ci-status arguments.
301298
expectArgsErr(['ref1', 'ref2'], /\barguments?\b/i);

0 commit comments

Comments
 (0)