mirror of https://github.com/actions/cache.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
659 B
TypeScript
23 lines
659 B
TypeScript
5 years ago
|
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"
|
||
|
);
|
||
|
});
|