diff --git a/tests/openIssues.test.js.skip b/tests/openIssues.test.js.skip index d224ac9fe..708ff9577 100644 --- a/tests/openIssues.test.js.skip +++ b/tests/openIssues.test.js.skip @@ -1,4 +1,16 @@ const commander = require('../'); describe('open issues', () => { + // https://github.com/tj/commander.js/issues/561 + test('#561: when specify argument and unknown option with no action handler then error', () => { + const program = new commander.Command(); + program + .exitOverride() + .option('-x, --x-flag', 'A flag') + .arguments(''); + + expect(() => { + program.parse(['node', 'test', '1', '--NONSENSE', '2', '3']); + }).toThrow(); + }); });