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.
22 lines
595 B
TypeScript
22 lines
595 B
TypeScript
5 years ago
|
import { getCacheVersion } from "../src/cacheHttpClient";
|
||
|
import { Inputs } from "../src/constants";
|
||
|
import * as testUtils from "../src/utils/testUtils";
|
||
|
|
||
|
afterEach(() => {
|
||
|
testUtils.clearInputs();
|
||
|
});
|
||
|
|
||
|
test("getCacheVersion with path input returns version", async () => {
|
||
|
testUtils.setInput(Inputs.Path, "node_modules");
|
||
|
|
||
|
const result = getCacheVersion();
|
||
|
|
||
|
expect(result).toEqual(
|
||
|
"b3e0c6cb5ecf32614eeb2997d905b9c297046d7cbf69062698f25b14b4cb0985"
|
||
|
);
|
||
|
});
|
||
|
|
||
|
test("getCacheVersion with no input throws", async () => {
|
||
|
expect(() => getCacheVersion()).toThrow();
|
||
|
});
|