Skip to content

Commit

Permalink
coverage and proper mocking
Browse files Browse the repository at this point in the history
Signed-off-by: jace-roell <[email protected]>
  • Loading branch information
jace-roell committed Dec 12, 2024
1 parent cd80570 commit a24a551
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { ConfigProfiles } from "../src/api";
import { IExtendersJsonOpts } from "../src/doc/IExtenderOpts";
import { ConfigSchema } from "../src/ConfigSchema";
import { Logger } from "../../logger/src/Logger";
import { IProfLocOsLoc } from "@zowe/imperative";

const testAppNm = "ProfInfoApp";
const testEnvPrefix = testAppNm.toUpperCase();
Expand Down Expand Up @@ -960,6 +961,14 @@ describe("TeamConfig ProfileInfo tests", () => {
const profInfo = createNewProfInfo(teamProjDir);
await profInfo.readProfilesFromDisk();

const mockResp: IProfLocOsLoc[] = [{
global: true,
name: "LPAR1",
path: "/mocked/path/xyz",
user: true
}];
jest.spyOn(ProfileInfo.prototype, "getOsLocInfo").mockReturnValue(mockResp);

// Simulate the condition where the active layer has no `defaults.base` but global and user layers exist
const layerActive = profInfo.getTeamConfig().layerActive();
delete layerActive.properties.defaults.base;
Expand Down

0 comments on commit a24a551

Please sign in to comment.