File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
e2e/spring-shell-e2e-tests/test Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,20 @@ describe('builtin commands', () => {
4747 await expect ( cli . exitCode ( ) ) . resolves . toBe ( 0 ) ;
4848 } ;
4949
50+ /**
51+ * test for command help succeed
52+ */
53+ const helpReturnsInfoDesc = 'command help returns info' ;
54+ const helpCommand = [ 'help' ] ;
55+ const helpReturnsInfo = async ( cli : Cli ) => {
56+ cli . run ( ) ;
57+ await waitForExpect ( async ( ) => {
58+ const screen = cli . screen ( ) ;
59+ expect ( screen ) . toEqual ( expect . arrayContaining ( [ expect . stringContaining ( 'AVAILABLE COMMANDS' ) ] ) ) ;
60+ } ) ;
61+ await expect ( cli . exitCode ( ) ) . resolves . toBe ( 0 ) ;
62+ } ;
63+
5064 beforeEach ( async ( ) => {
5165 waitForExpect . defaults . timeout = waitForExpectDefaultTimeout ;
5266 waitForExpect . defaults . interval = waitForExpectDefaultInterval ;
@@ -88,6 +102,18 @@ describe('builtin commands', () => {
88102 } ,
89103 testTimeout
90104 ) ;
105+
106+ it (
107+ helpReturnsInfoDesc ,
108+ async ( ) => {
109+ cli = new Cli ( {
110+ command : command ,
111+ options : [ ...options , ...helpCommand ]
112+ } ) ;
113+ await helpReturnsInfo ( cli ) ;
114+ } ,
115+ testTimeout
116+ ) ;
91117 } ) ;
92118
93119 /**
@@ -122,5 +148,17 @@ describe('builtin commands', () => {
122148 } ,
123149 testTimeout
124150 ) ;
151+
152+ it (
153+ helpReturnsInfoDesc ,
154+ async ( ) => {
155+ cli = new Cli ( {
156+ command : command ,
157+ options : [ ...options , ...helpCommand ]
158+ } ) ;
159+ await helpReturnsInfo ( cli ) ;
160+ } ,
161+ testTimeout
162+ ) ;
125163 } ) ;
126164} ) ;
You can’t perform that action at this time.
0 commit comments