Skip to content

Commit

Permalink
Added test for ubuntu check
Browse files Browse the repository at this point in the history
Signed-off-by: Saurabh Kamat <[email protected]>
  • Loading branch information
sauk2 committed Jul 22, 2024
1 parent be54672 commit dc167da
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions __test__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ describe("workflow test with a valid distro input", () => {
beforeAll(() => {
jest.spyOn(exec, "exec").mockImplementation(jest.fn());
jest.spyOn(core, "getInput").mockReturnValue("harmonic");
jest
.spyOn(utils, "determineDistribCodename")
.mockReturnValue(Promise.resolve("jammy"));
});

afterAll(() => {
Expand Down Expand Up @@ -95,6 +98,23 @@ describe("validate distribution test", () => {
});
});

describe("workflow test with incompatible Ubuntu combination", () => {
beforeAll(() => {
jest.spyOn(exec, "exec").mockImplementation(jest.fn());
jest.spyOn(core, "getInput").mockReturnValue("harmonic");
jest
.spyOn(utils, "determineDistribCodename")
.mockReturnValue(Promise.resolve("focal"));
});
afterAll(() => {
jest.resetAllMocks();
});

it("run Linux workflow with incompatible Ubuntu combination", async () => {
await expect(linux.runLinux()).rejects.toThrow();
});
});

describe("check for unstable repositories input", () => {
beforeAll(() => {
jest.spyOn(exec, "exec").mockImplementation(jest.fn());
Expand All @@ -108,6 +128,9 @@ describe("check for unstable repositories input", () => {
.spyOn(utils, "checkForUnstableAptRepos")
.mockReturnValueOnce(["prerelease", "nightly"]);
jest.spyOn(core, "getInput").mockReturnValue("harmonic");
jest
.spyOn(utils, "determineDistribCodename")
.mockReturnValue(Promise.resolve("jammy"));
});

afterAll(() => {
Expand Down

0 comments on commit dc167da

Please sign in to comment.