1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-04-20 11:46:22 +02:00
cache/__tests__/cacheHttpsClient.test.ts

22 lines
595 B
TypeScript
Raw Normal View History

2020-03-16 09:19:53 -07:00
import * as testUtils from "../src/utils/testUtils";
import { getCacheVersion } from "../src/cacheHttpClient";
2020-03-16 12:49:13 -07:00
import { Inputs } from "../src/constants";
2020-03-16 09:19:53 -07:00
afterEach(() => {
testUtils.clearInputs();
});
2020-03-16 12:49:13 -07:00
test("getCacheVersion with path input returns version", async () => {
testUtils.setInput(Inputs.Path, "node_modules");
2020-03-16 09:19:53 -07:00
const result = getCacheVersion();
expect(result).toEqual(
2020-03-16 12:49:13 -07:00
"b3e0c6cb5ecf32614eeb2997d905b9c297046d7cbf69062698f25b14b4cb0985"
2020-03-16 09:19:53 -07:00
);
});
test("getCacheVersion with no input throws", async () => {
expect(() => getCacheVersion()).toThrow();
});