File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,22 @@ test('args are passed `type: "string"` and "multiple"', function(t) {
233233 t . end ( ) ;
234234} ) ;
235235
236+ test ( 'when expecting `multiple:true` boolean option and option used multiple times then result includes array of booleans matching usage' , function ( t ) {
237+ const passedArgs = [ '--foo' , '--foo' ] ;
238+ const passedOptions = {
239+ foo : {
240+ type : 'boolean' ,
241+ multiple : true ,
242+ } ,
243+ } ;
244+ const expected = { flags : { foo : true } , values : { foo : [ true , true ] } , positionals : [ ] } ;
245+ const args = parseArgs ( { args : passedArgs , options : passedOptions } ) ;
246+
247+ t . deepEqual ( args , expected ) ;
248+
249+ t . end ( ) ;
250+ } ) ;
251+
236252test ( 'order of option and positional does not matter (per README)' , function ( t ) {
237253 const passedArgs1 = [ '--foo=bar' , 'baz' ] ;
238254 const passedArgs2 = [ 'baz' , '--foo=bar' ] ;
You can’t perform that action at this time.
0 commit comments