Skip to content

Commit

Permalink
test: add additional test for 1459
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Oct 30, 2019
1 parent 12c82e6 commit 52d875a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/validation.js
Expand Up @@ -848,6 +848,19 @@ describe('validation tests', () => {
args.foo.should.equal(true)
args.bar.should.equal(true)
})

it('does not fail when unrecognized option is passed after --', () => {
const args = yargs('ahoy ben -- --arrr')
.strict()
.command('ahoy <matey>', 'piratical courtesy')
.option('arrr', { boolean: true, describe: false })
.fail((msg) => {
expect.fail(msg)
})
.parse()
args.matey.should.equal('ben')
args._.should.deep.equal(['ahoy', '--arrr'])
})
})

describe('demandOption', () => {
Expand Down

0 comments on commit 52d875a

Please sign in to comment.