mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-24 05:09:54 +02:00
Initial commit
This commit is contained in:
parent
551cf17d91
commit
37c45447e4
20 changed files with 6242 additions and 0 deletions
22
__tests__/main.test.ts
Normal file
22
__tests__/main.test.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
import * as core from "@actions/core";
|
||||
|
||||
import { Inputs } from "../src/constants";
|
||||
import run from "../src/restore";
|
||||
import * as testUtils from "../src/utils/testUtils";
|
||||
|
||||
test("restore with no path", async () => {
|
||||
const failedMock = jest.spyOn(core, "setFailed");
|
||||
await run();
|
||||
expect(failedMock).toHaveBeenCalledWith(
|
||||
"Input required and not supplied: path"
|
||||
);
|
||||
});
|
||||
|
||||
test("restore with no key", async () => {
|
||||
testUtils.setInput(Inputs.Path, "node_modules");
|
||||
const failedMock = jest.spyOn(core, "setFailed");
|
||||
await run();
|
||||
expect(failedMock).toHaveBeenCalledWith(
|
||||
"Input required and not supplied: key"
|
||||
);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue