Skip to content

Commit

Permalink
test more than just numeric and boolean arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
henderea committed Jun 26, 2019
1 parent 5587c83 commit 83de6f7
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions test/yargs-parser.js
Expand Up @@ -2664,29 +2664,29 @@ describe('yargs-parser', function () {
})
})
it('should ignore unknown options in long format separated by space', function () {
const argv = parser('--known-arg 1 --unknown-arg 2', {
number: ['known-arg'],
const argv = parser('--known-arg a --unknown-arg b', {
string: ['known-arg'],
configuration: {
'parse-unknown-options': false
}
})
argv.should.deep.equal({
_: ['--unknown-arg', 2],
'known-arg': 1,
'knownArg': 1
_: ['--unknown-arg', 'b'],
'known-arg': 'a',
'knownArg': 'a'
})
})
it('should ignore unknown options in short dot format separated by equals', function () {
const argv = parser('-k.arg=1 -u.arg=2', {
number: ['k.arg'],
const argv = parser('-k.arg=a -u.arg=b', {
string: ['k.arg'],
configuration: {
'parse-unknown-options': false
}
})
argv.should.deep.equal({
_: ['-u.arg=2'],
_: ['-u.arg=b'],
'k': {
'arg': 1
'arg': 'a'
}
})
})
Expand All @@ -2705,15 +2705,15 @@ describe('yargs-parser', function () {
})
})
it('should ignore unknown options in short format separated by equals', function () {
const argv = parser('-k=1 -u=2', {
number: ['k'],
const argv = parser('-k=a -u=b', {
string: ['k'],
configuration: {
'parse-unknown-options': false
}
})
argv.should.deep.equal({
_: ['-u=2'],
'k': 1
_: ['-u=b'],
'k': 'a'
})
})
it('should ignore unknown options in short format followed by hyphen', function () {
Expand Down

0 comments on commit 83de6f7

Please sign in to comment.