@@ -2201,10 +2201,11 @@ describe('yargs-parser', function () {
22012201 parsed [ 'x' ] . should . equal ( 'b' )
22022202 } )
22032203 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 ' , {
22052205 array : [
22062206 { key : 'x' , string : true } ,
2207- { key : 'y' , string : true }
2207+ { key : 'y' , string : true } ,
2208+ { key : 'z' , string : true }
22082209 ] ,
22092210 configuration : {
22102211 'duplicate-arguments-array' : false
@@ -2213,12 +2214,14 @@ describe('yargs-parser', function () {
22132214
22142215 parsed [ 'x' ] . should . deep . equal ( [ 'a' , 'b' ] )
22152216 parsed [ 'y' ] . should . deep . equal ( [ 'c' ] )
2217+ parsed [ 'z' ] . should . deep . equal ( [ 'd' , 'e' ] )
22162218 } )
22172219 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 ' , {
22192221 array : [
22202222 { key : 'x' , number : true } ,
2221- { key : 'y' , number : true }
2223+ { key : 'y' , number : true } ,
2224+ { key : 'z' , number : true }
22222225 ] ,
22232226 configuration : {
22242227 'duplicate-arguments-array' : false
@@ -2227,6 +2230,7 @@ describe('yargs-parser', function () {
22272230
22282231 parsed [ 'x' ] . should . deep . equal ( [ 1 , 2 ] )
22292232 parsed [ 'y' ] . should . deep . equal ( [ 3 ] )
2233+ parsed [ 'z' ] . should . deep . equal ( [ 4 , 5 ] )
22302234 } )
22312235 it ( 'does not interfere with nargs' , function ( ) {
22322236 var parsed = parser ( '-x a b c -x o p q' , {
0 commit comments