@@ -2201,10 +2201,11 @@ describe('yargs-parser', function () {
2201
2201
parsed [ 'x' ] . should . equal ( 'b' )
2202
2202
} )
2203
2203
it ( 'array[string]: keeps all arguments - ignores configuration' , function ( ) {
2204
- var parsed = parser ( '-x a -x b -y c' , {
2204
+ var parsed = parser ( '-x a -x b -y c -z d e ' , {
2205
2205
array : [
2206
2206
{ key : 'x' , string : true } ,
2207
- { key : 'y' , string : true }
2207
+ { key : 'y' , string : true } ,
2208
+ { key : 'z' , string : true }
2208
2209
] ,
2209
2210
configuration : {
2210
2211
'duplicate-arguments-array' : false
@@ -2213,12 +2214,14 @@ describe('yargs-parser', function () {
2213
2214
2214
2215
parsed [ 'x' ] . should . deep . equal ( [ 'a' , 'b' ] )
2215
2216
parsed [ 'y' ] . should . deep . equal ( [ 'c' ] )
2217
+ parsed [ 'z' ] . should . deep . equal ( [ 'd' , 'e' ] )
2216
2218
} )
2217
2219
it ( 'array[number]: keeps all arguments - ignores configuration' , function ( ) {
2218
- var parsed = parser ( '-x 1 -x 2 -y 3' , {
2220
+ var parsed = parser ( '-x 1 -x 2 -y 3 -z 4 5 ' , {
2219
2221
array : [
2220
2222
{ key : 'x' , number : true } ,
2221
- { key : 'y' , number : true }
2223
+ { key : 'y' , number : true } ,
2224
+ { key : 'z' , number : true }
2222
2225
] ,
2223
2226
configuration : {
2224
2227
'duplicate-arguments-array' : false
@@ -2227,6 +2230,7 @@ describe('yargs-parser', function () {
2227
2230
2228
2231
parsed [ 'x' ] . should . deep . equal ( [ 1 , 2 ] )
2229
2232
parsed [ 'y' ] . should . deep . equal ( [ 3 ] )
2233
+ parsed [ 'z' ] . should . deep . equal ( [ 4 , 5 ] )
2230
2234
} )
2231
2235
it ( 'does not interfere with nargs' , function ( ) {
2232
2236
var parsed = parser ( '-x a b c -x o p q' , {
0 commit comments