Loading __tests__/restore.test.ts +4 −9 Changes for __tests__/restore.test.ts: 4 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ beforeAll(() => { beforeEach(() => { process.env[Events.Key] = Events.Push; process.env[RefKey] = "refs/heads/feature-branch"; jest.spyOn(actionUtils, "isGhes").mockImplementation(() => false); }); afterEach(() => { Loading @@ -54,15 +56,11 @@ test("restore with invalid event outputs warning", async () => { }); test("restore on GHES should no-op", async () => { try { process.env["GITHUB_SERVER_URL"] = "http://example.com"; jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true); const infoMock = jest.spyOn(core, "info"); const restoreCacheMock = jest.spyOn(cache, "restoreCache"); const setCacheHitOutputMock = jest.spyOn( actionUtils, "setCacheHitOutput" ); const setCacheHitOutputMock = jest.spyOn(actionUtils, "setCacheHitOutput"); await run(); Loading @@ -72,9 +70,6 @@ test("restore on GHES should no-op", async () => { expect(infoMock).toHaveBeenCalledWith( "Cache action is not supported on GHES" ); } finally { process.env["GITHUB_SERVER_URL"] = undefined; } }); test("restore with no path should fail", async () => { Loading __tests__/save.test.ts +3 −5 Changes for __tests__/save.test.ts: 3 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -44,6 +44,8 @@ beforeAll(() => { beforeEach(() => { process.env[Events.Key] = Events.Push; process.env[RefKey] = "refs/heads/feature-branch"; jest.spyOn(actionUtils, "isGhes").mockImplementation(() => false); }); afterEach(() => { Loading Loading @@ -92,8 +94,7 @@ test("save with no primary key in state outputs warning", async () => { }); test("save on GHES should no-op", async () => { try { process.env["GITHUB_SERVER_URL"] = "http://example.com"; jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true); const infoMock = jest.spyOn(core, "info"); const saveCacheMock = jest.spyOn(cache, "saveCache"); Loading @@ -104,9 +105,6 @@ test("save on GHES should no-op", async () => { expect(infoMock).toHaveBeenCalledWith( "Cache action is not supported on GHES" ); } finally { process.env["GITHUB_SERVER_URL"] = undefined; } }); test("save with exact match returns early", async () => { Loading Loading
__tests__/restore.test.ts +4 −9 Changes for __tests__/restore.test.ts: 4 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ beforeAll(() => { beforeEach(() => { process.env[Events.Key] = Events.Push; process.env[RefKey] = "refs/heads/feature-branch"; jest.spyOn(actionUtils, "isGhes").mockImplementation(() => false); }); afterEach(() => { Loading @@ -54,15 +56,11 @@ test("restore with invalid event outputs warning", async () => { }); test("restore on GHES should no-op", async () => { try { process.env["GITHUB_SERVER_URL"] = "http://example.com"; jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true); const infoMock = jest.spyOn(core, "info"); const restoreCacheMock = jest.spyOn(cache, "restoreCache"); const setCacheHitOutputMock = jest.spyOn( actionUtils, "setCacheHitOutput" ); const setCacheHitOutputMock = jest.spyOn(actionUtils, "setCacheHitOutput"); await run(); Loading @@ -72,9 +70,6 @@ test("restore on GHES should no-op", async () => { expect(infoMock).toHaveBeenCalledWith( "Cache action is not supported on GHES" ); } finally { process.env["GITHUB_SERVER_URL"] = undefined; } }); test("restore with no path should fail", async () => { Loading
__tests__/save.test.ts +3 −5 Changes for __tests__/save.test.ts: 3 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -44,6 +44,8 @@ beforeAll(() => { beforeEach(() => { process.env[Events.Key] = Events.Push; process.env[RefKey] = "refs/heads/feature-branch"; jest.spyOn(actionUtils, "isGhes").mockImplementation(() => false); }); afterEach(() => { Loading Loading @@ -92,8 +94,7 @@ test("save with no primary key in state outputs warning", async () => { }); test("save on GHES should no-op", async () => { try { process.env["GITHUB_SERVER_URL"] = "http://example.com"; jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true); const infoMock = jest.spyOn(core, "info"); const saveCacheMock = jest.spyOn(cache, "saveCache"); Loading @@ -104,9 +105,6 @@ test("save on GHES should no-op", async () => { expect(infoMock).toHaveBeenCalledWith( "Cache action is not supported on GHES" ); } finally { process.env["GITHUB_SERVER_URL"] = undefined; } }); test("save with exact match returns early", async () => { Loading