Skip to content

Commit 83de6f7

Browse files
committed
test more than just numeric and boolean arguments
1 parent 5587c83 commit 83de6f7

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

test/yargs-parser.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,29 +2664,29 @@ describe('yargs-parser', function () {
26642664
})
26652665
})
26662666
it('should ignore unknown options in long format separated by space', function () {
2667-
const argv = parser('--known-arg 1 --unknown-arg 2', {
2668-
number: ['known-arg'],
2667+
const argv = parser('--known-arg a --unknown-arg b', {
2668+
string: ['known-arg'],
26692669
configuration: {
26702670
'parse-unknown-options': false
26712671
}
26722672
})
26732673
argv.should.deep.equal({
2674-
_: ['--unknown-arg', 2],
2675-
'known-arg': 1,
2676-
'knownArg': 1
2674+
_: ['--unknown-arg', 'b'],
2675+
'known-arg': 'a',
2676+
'knownArg': 'a'
26772677
})
26782678
})
26792679
it('should ignore unknown options in short dot format separated by equals', function () {
2680-
const argv = parser('-k.arg=1 -u.arg=2', {
2681-
number: ['k.arg'],
2680+
const argv = parser('-k.arg=a -u.arg=b', {
2681+
string: ['k.arg'],
26822682
configuration: {
26832683
'parse-unknown-options': false
26842684
}
26852685
})
26862686
argv.should.deep.equal({
2687-
_: ['-u.arg=2'],
2687+
_: ['-u.arg=b'],
26882688
'k': {
2689-
'arg': 1
2689+
'arg': 'a'
26902690
}
26912691
})
26922692
})
@@ -2705,15 +2705,15 @@ describe('yargs-parser', function () {
27052705
})
27062706
})
27072707
it('should ignore unknown options in short format separated by equals', function () {
2708-
const argv = parser('-k=1 -u=2', {
2709-
number: ['k'],
2708+
const argv = parser('-k=a -u=b', {
2709+
string: ['k'],
27102710
configuration: {
27112711
'parse-unknown-options': false
27122712
}
27132713
})
27142714
argv.should.deep.equal({
2715-
_: ['-u=2'],
2716-
'k': 1
2715+
_: ['-u=b'],
2716+
'k': 'a'
27172717
})
27182718
})
27192719
it('should ignore unknown options in short format followed by hyphen', function () {

0 commit comments

Comments
 (0)