@@ -32,6 +32,21 @@ describe('builtin commands', () => {
32
32
await expect ( cli . exitCode ( ) ) . resolves . toBe ( 0 ) ;
33
33
} ;
34
34
35
+ /**
36
+ * test for command help command returns expected info
37
+ */
38
+ const commandHelpReturnsInfoDesc = 'command help returns info' ;
39
+ const commandHelpCommand = [ 'help help' ] ;
40
+ const commandHelpReturnsInfo = async ( cli : Cli ) => {
41
+ cli . run ( ) ;
42
+ await waitForExpect ( async ( ) => {
43
+ const screen = cli . screen ( ) ;
44
+ expect ( screen ) . toEqual ( expect . arrayContaining ( [ expect . stringContaining ( 'OPTIONS' ) ] ) ) ;
45
+ expect ( screen ) . not . toEqual ( expect . arrayContaining ( [ expect . stringContaining ( 'CURRENTLY UNAVAILABLE' ) ] ) ) ;
46
+ } ) ;
47
+ await expect ( cli . exitCode ( ) ) . resolves . toBe ( 0 ) ;
48
+ } ;
49
+
35
50
beforeEach ( async ( ) => {
36
51
waitForExpect . defaults . timeout = waitForExpectDefaultTimeout ;
37
52
waitForExpect . defaults . interval = waitForExpectDefaultInterval ;
@@ -61,6 +76,18 @@ describe('builtin commands', () => {
61
76
} ,
62
77
testTimeout
63
78
) ;
79
+
80
+ it (
81
+ commandHelpReturnsInfoDesc ,
82
+ async ( ) => {
83
+ cli = new Cli ( {
84
+ command : command ,
85
+ options : [ ...options , ...commandHelpCommand ]
86
+ } ) ;
87
+ await commandHelpReturnsInfo ( cli ) ;
88
+ } ,
89
+ testTimeout
90
+ ) ;
64
91
} ) ;
65
92
66
93
/**
@@ -83,5 +110,17 @@ describe('builtin commands', () => {
83
110
} ,
84
111
testTimeout
85
112
) ;
113
+
114
+ it (
115
+ commandHelpReturnsInfoDesc ,
116
+ async ( ) => {
117
+ cli = new Cli ( {
118
+ command : command ,
119
+ options : [ ...options , ...commandHelpCommand ]
120
+ } ) ;
121
+ await commandHelpReturnsInfo ( cli ) ;
122
+ } ,
123
+ testTimeout
124
+ ) ;
86
125
} ) ;
87
126
} ) ;
0 commit comments