Skip to content

Commit

Permalink
add missing coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Rudy Flores <[email protected]>
  • Loading branch information
rudyflores committed Oct 30, 2023
1 parent 63ee782 commit f2d0317
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,23 @@ describe("ProfilesUtils unit tests", () => {
expect(profUtils.ProfilesUtils.getCredentialManagerOverride()).toBe("My Custom Credential Manager");
expect(zoweLoggerTraceSpy).toBeCalledTimes(1);
});

it("should return default manager if the override file does not exist", () => {
const zoweLoggerTraceSpy = jest.spyOn(ZoweLogger, "trace");
const zoweLoggerInfoSpy = jest.spyOn(ZoweLogger, "info");

jest.spyOn(fs, "readFileSync").mockImplementation(() => {
throw new Error("test");
});
try {
profUtils.ProfilesUtils.getCredentialManagerOverride();
} catch (err) {
expect(err).toBe("test");
}

expect(zoweLoggerTraceSpy).toBeCalledTimes(1);
expect(zoweLoggerInfoSpy).toBeCalledTimes(1);
});
});

describe("setupCustomCredentialManager", () => {
Expand Down

0 comments on commit f2d0317

Please sign in to comment.