Skip to content

Commit 52d875a

Browse files
author
bcoe
committed
test: add additional test for 1459
1 parent 12c82e6 commit 52d875a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/validation.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,19 @@ describe('validation tests', () => {
848848
args.foo.should.equal(true)
849849
args.bar.should.equal(true)
850850
})
851+
852+
it('does not fail when unrecognized option is passed after --', () => {
853+
const args = yargs('ahoy ben -- --arrr')
854+
.strict()
855+
.command('ahoy <matey>', 'piratical courtesy')
856+
.option('arrr', { boolean: true, describe: false })
857+
.fail((msg) => {
858+
expect.fail(msg)
859+
})
860+
.parse()
861+
args.matey.should.equal('ben')
862+
args._.should.deep.equal(['ahoy', '--arrr'])
863+
})
851864
})
852865

853866
describe('demandOption', () => {

0 commit comments

Comments
 (0)