Skip to content

Commit

Permalink
Fix CommandProcessor unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
  • Loading branch information
t1m0thyj committed Jul 26, 2024
1 parent e4918c7 commit 743182b
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,7 @@ describe("Command Processor", () => {
rootCommandName: SAMPLE_ROOT_COMMAND,
commandLine: "",
promptPhrase: "dummydummy",
config: ImperativeConfig.instance.config
config: ImperativeConfig.instance.config
});

// Mock the profile loader
Expand Down Expand Up @@ -1592,7 +1592,7 @@ describe("Command Processor", () => {
rootCommandName: SAMPLE_ROOT_COMMAND,
commandLine: "",
promptPhrase: "dummydummy",
config: ImperativeConfig.instance.config
config: ImperativeConfig.instance.config
});

// Mock the profile loader
Expand Down Expand Up @@ -1661,13 +1661,26 @@ describe("Command Processor", () => {
}
},
helpGenerator: FAKE_HELP_GENERATOR,
profileManagerFactory: FAKE_PROFILE_MANAGER_FACTORY,
rootCommandName: SAMPLE_ROOT_COMMAND,
commandLine: "",
promptPhrase: "dummydummy",
config: ImperativeConfig.instance.config
});

// Mock the profile loader
(CommandProfileLoader.loader as any) = jest.fn((args) => {
return {
loadProfiles: (profArgs: any) => {
return;
}
};
});

// return the "fake" args object with values from profile
CliUtils.getOptValueFromProfiles = jest.fn((cmdProfiles, profileDef, allOpts) => {
return {};
});

const parms: any = {
arguments: {
_: ["check", "for", "banana"],
Expand Down

0 comments on commit 743182b

Please sign in to comment.