From 5e7f2c1182ab8e08ac7b94e551b91b4b47941e5e Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Sun, 11 Dec 2022 16:47:35 +0000 Subject: [PATCH] Fixed breaking test case --- __tests__/save.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/__tests__/save.test.ts b/__tests__/save.test.ts index 8b3b356..63b3aa5 100644 --- a/__tests__/save.test.ts +++ b/__tests__/save.test.ts @@ -15,6 +15,10 @@ beforeAll(() => { return jest.requireActual("@actions/core").getInput(name, options); }); + jest.spyOn(core, "getState").mockImplementation(name => { + return jest.requireActual("@actions/core").getState(name); + }); + jest.spyOn(actionUtils, "getInputAsArray").mockImplementation( (name, options) => { return jest @@ -70,11 +74,11 @@ test("save with valid inputs uploads a cache", async () => { jest.spyOn(core, "getState") // Cache Entry State .mockImplementationOnce(() => { - return savedCacheKey; + return primaryKey; }) // Cache Key State .mockImplementationOnce(() => { - return primaryKey; + return savedCacheKey; }); const inputPath = "node_modules";