mirror of
https://code.forgejo.org/actions/cache.git
synced 2024-11-05 10:12:55 +01:00
Update tests to expect cache-path to exist as an output
This commit is contained in:
parent
b6cff214f7
commit
b3f0756597
1 changed files with 7 additions and 3 deletions
|
@ -86,7 +86,8 @@ test("restore with no cache found", async () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
||||||
expect(outputMock).toHaveBeenCalledTimes(1);
|
expect(outputMock).toHaveBeenCalledWith("cache-path", path);
|
||||||
|
expect(outputMock).toHaveBeenCalledTimes(2);
|
||||||
expect(failedMock).toHaveBeenCalledTimes(0);
|
expect(failedMock).toHaveBeenCalledTimes(0);
|
||||||
|
|
||||||
expect(infoMock).toHaveBeenCalledWith(
|
expect(infoMock).toHaveBeenCalledWith(
|
||||||
|
@ -128,6 +129,7 @@ test("restore with restore keys and no cache found", async () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
||||||
|
expect(outputMock).toHaveBeenCalledWith("cache-path", path);
|
||||||
expect(failedMock).toHaveBeenCalledTimes(0);
|
expect(failedMock).toHaveBeenCalledTimes(0);
|
||||||
|
|
||||||
expect(infoMock).toHaveBeenCalledWith(
|
expect(infoMock).toHaveBeenCalledWith(
|
||||||
|
@ -169,8 +171,9 @@ test("restore with cache found for key", async () => {
|
||||||
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
||||||
expect(outputMock).toHaveBeenCalledWith("cache-hit", "true");
|
expect(outputMock).toHaveBeenCalledWith("cache-hit", "true");
|
||||||
expect(outputMock).toHaveBeenCalledWith("cache-matched-key", key);
|
expect(outputMock).toHaveBeenCalledWith("cache-matched-key", key);
|
||||||
|
expect(outputMock).toHaveBeenCalledWith("cache-path", path);
|
||||||
|
|
||||||
expect(outputMock).toHaveBeenCalledTimes(3);
|
expect(outputMock).toHaveBeenCalledTimes(4);
|
||||||
|
|
||||||
expect(infoMock).toHaveBeenCalledWith(`Cache restored from key: ${key}`);
|
expect(infoMock).toHaveBeenCalledWith(`Cache restored from key: ${key}`);
|
||||||
expect(failedMock).toHaveBeenCalledTimes(0);
|
expect(failedMock).toHaveBeenCalledTimes(0);
|
||||||
|
@ -212,8 +215,9 @@ test("restore with cache found for restore key", async () => {
|
||||||
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
||||||
expect(outputMock).toHaveBeenCalledWith("cache-hit", "false");
|
expect(outputMock).toHaveBeenCalledWith("cache-hit", "false");
|
||||||
expect(outputMock).toHaveBeenCalledWith("cache-matched-key", restoreKey);
|
expect(outputMock).toHaveBeenCalledWith("cache-matched-key", restoreKey);
|
||||||
|
expect(outputMock).toHaveBeenCalledWith("cache-path", path);
|
||||||
|
|
||||||
expect(outputMock).toHaveBeenCalledTimes(3);
|
expect(outputMock).toHaveBeenCalledTimes(4);
|
||||||
|
|
||||||
expect(infoMock).toHaveBeenCalledWith(
|
expect(infoMock).toHaveBeenCalledWith(
|
||||||
`Cache restored from key: ${restoreKey}`
|
`Cache restored from key: ${restoreKey}`
|
||||||
|
|
Loading…
Reference in a new issue