This commit is contained in:
Josh Soref 2022-05-07 03:15:29 -07:00 committed by GitHub
commit e9b65c3cba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 59 additions and 13 deletions

View file

@ -208,6 +208,7 @@ test("restore with no cache found", async () => {
const infoMock = jest.spyOn(core, "info");
const failedMock = jest.spyOn(core, "setFailed");
const stateMock = jest.spyOn(core, "saveState");
const setOutputMock = jest.spyOn(core, "setOutput");
const restoreCacheMock = jest
.spyOn(cache, "restoreCache")
.mockImplementationOnce(() => {
@ -222,6 +223,8 @@ test("restore with no cache found", async () => {
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
expect(failedMock).toHaveBeenCalledTimes(0);
expect(setOutputMock).toHaveBeenCalledTimes(0);
expect(infoMock).toHaveBeenCalledWith(
`Cache not found for input keys: ${key}`
);
@ -320,7 +323,7 @@ test("restore with cache found for key", async () => {
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
expect(setCacheHitOutputMock).toHaveBeenCalledWith(true);
expect(infoMock).toHaveBeenCalledWith(`Cache restored from key: ${key}`);
expect(infoMock).toHaveBeenCalledWith(`Cache restored for key: ${key}`);
expect(failedMock).toHaveBeenCalledTimes(0);
});