File tree 1 file changed +16
-0
lines changed
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) {
233
233
t . end ( ) ;
234
234
} ) ;
235
235
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
+
236
252
test ( 'order of option and positional does not matter (per README)' , function ( t ) {
237
253
const passedArgs1 = [ '--foo=bar' , 'baz' ] ;
238
254
const passedArgs2 = [ 'baz' , '--foo=bar' ] ;
You can’t perform that action at this time.
0 commit comments