3
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-04-27 13:45:51 +00:00

React to feeback and change to use 0.2.0 cache package

This commit is contained in:
Aiqiao Yan 2020-05-19 13:46:58 -04:00
parent 249a22026d
commit bcc23b930f
10 changed files with 5098 additions and 5604 deletions

View file

@ -79,7 +79,7 @@ test("setOutputAndState with exact match to set cache-hit output and state", ()
expect(setOutputMock).toHaveBeenCalledWith(Outputs.CacheHit, "true");
expect(setOutputMock).toHaveBeenCalledTimes(1);
expect(saveStateMock).toHaveBeenCalledWith(State.CacheResult, cacheKey);
expect(saveStateMock).toHaveBeenCalledWith(State.CacheMatchedKey, cacheKey);
expect(saveStateMock).toHaveBeenCalledTimes(1);
});
@ -95,7 +95,7 @@ test("setOutputAndState with no exact match to set cache-hit output and state",
expect(setOutputMock).toHaveBeenCalledWith(Outputs.CacheHit, "false");
expect(setOutputMock).toHaveBeenCalledTimes(1);
expect(saveStateMock).toHaveBeenCalledWith(State.CacheResult, cacheKey);
expect(saveStateMock).toHaveBeenCalledWith(State.CacheMatchedKey, cacheKey);
expect(saveStateMock).toHaveBeenCalledTimes(1);
});
@ -109,7 +109,7 @@ test("getCacheState with no state returns undefined", () => {
expect(state).toBe(undefined);
expect(getStateMock).toHaveBeenCalledWith(State.CacheResult);
expect(getStateMock).toHaveBeenCalledWith(State.CacheMatchedKey);
expect(getStateMock).toHaveBeenCalledTimes(1);
});
@ -125,7 +125,7 @@ test("getCacheState with valid state", () => {
expect(state).toEqual(cacheKey);
expect(getStateMock).toHaveBeenCalledWith(State.CacheResult);
expect(getStateMock).toHaveBeenCalledWith(State.CacheMatchedKey);
expect(getStateMock).toHaveBeenCalledTimes(1);
});