diff --git a/e2e/spring-shell-e2e-tests/test/builtin.test.ts b/e2e/spring-shell-e2e-tests/test/builtin.test.ts index db388ef7..0a6f4747 100644 --- a/e2e/spring-shell-e2e-tests/test/builtin.test.ts +++ b/e2e/spring-shell-e2e-tests/test/builtin.test.ts @@ -47,6 +47,20 @@ describe('builtin commands', () => { await expect(cli.exitCode()).resolves.toBe(0); }; + /** + * test for command help succeed + */ + const helpReturnsInfoDesc = 'command help returns info'; + const helpCommand = ['help']; + const helpReturnsInfo = async (cli: Cli) => { + cli.run(); + await waitForExpect(async () => { + const screen = cli.screen(); + expect(screen).toEqual(expect.arrayContaining([expect.stringContaining('AVAILABLE COMMANDS')])); + }); + await expect(cli.exitCode()).resolves.toBe(0); + }; + beforeEach(async () => { waitForExpect.defaults.timeout = waitForExpectDefaultTimeout; waitForExpect.defaults.interval = waitForExpectDefaultInterval; @@ -88,6 +102,18 @@ describe('builtin commands', () => { }, testTimeout ); + + it( + helpReturnsInfoDesc, + async () => { + cli = new Cli({ + command: command, + options: [...options, ...helpCommand] + }); + await helpReturnsInfo(cli); + }, + testTimeout + ); }); /** @@ -122,5 +148,17 @@ describe('builtin commands', () => { }, testTimeout ); + + it( + helpReturnsInfoDesc, + async () => { + cli = new Cli({ + command: command, + options: [...options, ...helpCommand] + }); + await helpReturnsInfo(cli); + }, + testTimeout + ); }); });