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 @@ -68,6 +68,22 @@ describe('helpOption', () => {
68
68
expect ( helpInformation ) . toMatch ( / - C , - - c u s t o m - h e l p + c u s t o m h e l p o u t p u t / ) ;
69
69
} ) ;
70
70
71
+ test ( 'when helpOption has just flags then helpInformation includes default description' , ( ) => {
72
+ const program = new commander . Command ( ) ;
73
+ program
74
+ . helpOption ( '-C,--custom-help' ) ;
75
+ const helpInformation = program . helpInformation ( ) ;
76
+ expect ( helpInformation ) . toMatch ( / - C , - - c u s t o m - h e l p + d i s p l a y h e l p f o r c o m m a n d / ) ;
77
+ } ) ;
78
+
79
+ test ( 'when helpOption has just description then helpInformation includes default flags' , ( ) => {
80
+ const program = new commander . Command ( ) ;
81
+ program
82
+ . helpOption ( undefined , 'custom help output' ) ;
83
+ const helpInformation = program . helpInformation ( ) ;
84
+ expect ( helpInformation ) . toMatch ( / - h , - - h e l p + c u s t o m h e l p o u t p u t / ) ;
85
+ } ) ;
86
+
71
87
test ( 'when helpOption(false) then helpInformation does not include --help' , ( ) => {
72
88
const program = new commander . Command ( ) ;
73
89
program
You can’t perform that action at this time.
0 commit comments