Skip to content

Commit

Permalink
Merge branch 'master' into fix/event-emitter-skip
Browse files Browse the repository at this point in the history
  • Loading branch information
t1m0thyj committed Nov 13, 2024
2 parents 4a2f376 + 53cc0d0 commit e7ca97e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/imperative/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to the Imperative package will be documented in this file.
## Recent Changes

- BugFix: Fixed an issue where the Imperative Event Emitter could skip triggering event callbacks. [#2360](https://github.com/zowe/zowe-cli/pull/2360)
- BugFix: Enhanced [#2301](https://github.com/zowe/zowe-cli/pull/2301) to include "--help-web" commands to pass even if presence of a faulty configuration.

## `8.8.1`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ describe("Hello World", () => {
expect(response.stdout.toString()).toContain("help");
expect(response.stderr.toString()).toContain("Please check this configuration file for errors.");
});

it ("should trigger help-web even if bad config", async () => {
const response = await TestUtils.runCliScript(__dirname + "/scripts/help.sh", TEST_ENVIRONMENT.workingDir);
expect(response.status).toBe(0);
expect(response.stdout.toString()).toContain("help-web");
expect(response.stderr.toString()).toContain("Please check this configuration file for errors.");
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
hello-world-cli --help-web
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ describe("Command Processor", () => {
jest.restoreAllMocks();
});

it("should fail command execution without --help or --version if config is faulty", async () => {
it("should fail command execution without --help, --help-web or --version if config is faulty", async () => {
const parms: any = { arguments: { _: ["some", "command"], $0: "" }, silent: true };
const response: ICommandResponse = await faultyConfigProcessor.invoke(parms);

Expand Down
2 changes: 2 additions & 0 deletions packages/imperative/src/imperative/src/Imperative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ export class Imperative {
// Detect CLI arguments to determine if errors should be ignored
const ignoreErrors = process.argv.includes(Constants.OPT_LONG_DASH + Constants.HELP_OPTION) ||
process.argv.includes(Constants.OPT_SHORT_DASH + Constants.HELP_OPTION_ALIAS) ||
process.argv.includes(Constants.OPT_LONG_DASH + Constants.HELP_WEB_OPTION) ||
process.argv.includes(Constants.OPT_SHORT_DASH + Constants.HELP_WEB_OPTION_ALIAS) ||
process.argv.includes(Constants.OPT_LONG_DASH + Constants.VERSION_OPTION) ||
process.argv.includes(Constants.OPT_SHORT_DASH + Constants.VERSION_OPTION_ALIAS) ||
process.argv[process.argv.length - 1] === require.resolve('@zowe/cli');
Expand Down

0 comments on commit e7ca97e

Please sign in to comment.