File tree Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Original file line number Diff line number Diff line change @@ -393,37 +393,6 @@ describe('docs', () => {
393
393
} ) ;
394
394
} ) ;
395
395
describe ( 'subparsers' , ( ) => {
396
- test ( 'default' , async ( ) => {
397
- const subparser = new Parser ( )
398
- . option ( 'greeting' , {
399
- longFlag : '--greeting' ,
400
- shortFlag : '-g' ,
401
- defaultValue : '' ,
402
- } )
403
- . defaultHandler ( ( { options } ) => {
404
- console . log ( options . greeting ) ;
405
- } ) ;
406
-
407
- const parser = new Parser ( )
408
- . option ( 'greeting' , {
409
- longFlag : '--greeting' ,
410
- shortFlag : '-g' ,
411
- defaultValue : '' ,
412
- } )
413
- . subparser ( 'v2' , {
414
- parser : subparser ,
415
- description : 'Version 2 of this CLI' ,
416
- } )
417
- . defaultHandler ( ( { options } ) => {
418
- console . log ( options . greeting ) ;
419
- } ) ;
420
-
421
- await parser . parse ( [ '-g' , 'hello from the main parser' ] ) . call ( ) ;
422
- expect ( consoleLog ) . toHaveBeenLastCalledWith ( 'hello from the main parser' ) ;
423
-
424
- await parser . parse ( [ 'v2' , '-g' , 'hello from the subparser' ] ) . call ( ) ;
425
- expect ( consoleLog ) . toHaveBeenLastCalledWith ( 'hello from the subparser' ) ;
426
- } ) ;
427
396
test ( 'with shared options' , async ( ) => {
428
397
type CommonOptions = {
429
398
verbose : boolean ;
You can’t perform that action at this time.
0 commit comments