Merge branch 'master' into joshmgross/validate-event-type

This commit is contained in:
Josh Gross 2019-11-13 10:19:56 -05:00 committed by GitHub
commit 7c937ff3b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 1115 additions and 114 deletions

View file

@ -1,9 +1,7 @@
import * as core from "@actions/core";
import * as exec from "@actions/exec";
import * as io from "@actions/io";
import * as path from "path";
import * as cacheHttpClient from "../src/cacheHttpClient";
import { Events, Inputs } from "../src/constants";
import { ArtifactCacheEntry } from "../src/contracts";
@ -133,7 +131,7 @@ test("restore with no cache found", async () => {
const stateMock = jest.spyOn(core, "saveState");
const clientMock = jest.spyOn(cacheHttpClient, "getCacheEntry");
clientMock.mockImplementation(_ => {
clientMock.mockImplementation(() => {
return Promise.resolve(null);
});
@ -160,7 +158,7 @@ test("restore with server error should fail", async () => {
const stateMock = jest.spyOn(core, "saveState");
const clientMock = jest.spyOn(cacheHttpClient, "getCacheEntry");
clientMock.mockImplementation(_ => {
clientMock.mockImplementation(() => {
throw new Error("HTTP Error Occurred");
});
@ -194,7 +192,7 @@ test("restore with restore keys and no cache found", async () => {
const stateMock = jest.spyOn(core, "saveState");
const clientMock = jest.spyOn(cacheHttpClient, "getCacheEntry");
clientMock.mockImplementation(_ => {
clientMock.mockImplementation(() => {
return Promise.resolve(null);
});
@ -228,7 +226,7 @@ test("restore with cache found", async () => {
archiveLocation: "www.actionscache.test/download"
};
const getCacheMock = jest.spyOn(cacheHttpClient, "getCacheEntry");
getCacheMock.mockImplementation(_ => {
getCacheMock.mockImplementation(() => {
return Promise.resolve(cacheEntry);
});
const tempPath = "/foo/bar";
@ -380,7 +378,7 @@ test("restore with cache found for restore key", async () => {
archiveLocation: "www.actionscache.test/download"
};
const getCacheMock = jest.spyOn(cacheHttpClient, "getCacheEntry");
getCacheMock.mockImplementation(_ => {
getCacheMock.mockImplementation(() => {
return Promise.resolve(cacheEntry);
});
const tempPath = "/foo/bar";