Fix save-always/post-if with an output

This commit is contained in:
Danny Gleckler 2024-02-08 20:07:45 -05:00
parent 0c45773b62
commit 7214f3c546
6 changed files with 65 additions and 16 deletions

View file

@ -86,7 +86,8 @@ test("restore with no cache found", async () => {
);
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
expect(outputMock).toHaveBeenCalledTimes(1);
expect(outputMock).toHaveBeenCalledWith("save-always-d18d746b9", "");
expect(outputMock).toHaveBeenCalledTimes(2);
expect(failedMock).toHaveBeenCalledTimes(0);
expect(infoMock).toHaveBeenCalledWith(
@ -169,8 +170,9 @@ test("restore with cache found for key", async () => {
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
expect(outputMock).toHaveBeenCalledWith("cache-hit", "true");
expect(outputMock).toHaveBeenCalledWith("cache-matched-key", key);
expect(outputMock).toHaveBeenCalledWith("save-always-d18d746b9", "");
expect(outputMock).toHaveBeenCalledTimes(3);
expect(outputMock).toHaveBeenCalledTimes(4);
expect(infoMock).toHaveBeenCalledWith(`Cache restored from key: ${key}`);
expect(failedMock).toHaveBeenCalledTimes(0);
@ -212,8 +214,9 @@ test("restore with cache found for restore key", async () => {
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
expect(outputMock).toHaveBeenCalledWith("cache-hit", "false");
expect(outputMock).toHaveBeenCalledWith("cache-matched-key", restoreKey);
expect(outputMock).toHaveBeenCalledWith("save-always-d18d746b9", "");
expect(outputMock).toHaveBeenCalledTimes(3);
expect(outputMock).toHaveBeenCalledTimes(4);
expect(infoMock).toHaveBeenCalledWith(
`Cache restored from key: ${restoreKey}`