1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-05-10 19:19:54 +02:00

Merge master into ethanis/cache-multiple-paths

This commit is contained in:
Ethan Dennis 2020-03-18 17:35:59 -07:00
commit f68f5d03cc
No known key found for this signature in database
GPG key ID: 32E74B75DB4065DD
15 changed files with 3437 additions and 602 deletions

View file

@ -1,5 +1,6 @@
import * as core from "@actions/core";
import * as path from "path";
import * as cacheHttpClient from "../src/cacheHttpClient";
import { Events, Inputs } from "../src/constants";
import { ArtifactCacheEntry } from "../src/contracts";
@ -236,6 +237,7 @@ test("restore with cache found", async () => {
.mockReturnValue(fileSize);
const extractTarMock = jest.spyOn(tar, "extractTar");
const unlinkFileMock = jest.spyOn(actionUtils, "unlinkFile");
const setCacheHitOutputMock = jest.spyOn(actionUtils, "setCacheHitOutput");
await run();
@ -253,6 +255,9 @@ test("restore with cache found", async () => {
expect(extractTarMock).toHaveBeenCalledTimes(1);
expect(extractTarMock).toHaveBeenCalledWith(archivePath);
expect(unlinkFileMock).toHaveBeenCalledTimes(1);
expect(unlinkFileMock).toHaveBeenCalledWith(archivePath);
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
expect(setCacheHitOutputMock).toHaveBeenCalledWith(true);