Skip to content

Commit

Permalink
additional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Oct 28, 2019
1 parent f5adb00 commit 61958aa
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/yargs-parser.js
Expand Up @@ -1487,6 +1487,24 @@ describe('yargs-parser', function () {
], { count: 'v' })
parsed.v.should.equal(8)
})

it('should add an error if counter is also set as array', function () {
var argv = parser.detailed(['--counter', '--counter', '--counter'], {
count: ['counter'],
array: ['counter']
})

argv.error.message.should.equal('Invalid configuration: counter, opts.count excludes opts.array.')
})

it('should add an error if counter is also set as narg', function () {
var argv = parser.detailed(['--counter', 'foo', 'bar'], {
count: ['counter'],
narg: { 'counter': 2 }
})

argv.error.message.should.equal('Invalid configuration: counter, opts.count excludes opts.narg.')
})
})

describe('array', function () {
Expand Down

0 comments on commit 61958aa

Please sign in to comment.