Another attempt to fix tests

This commit is contained in:
Nick Cipollo
2020-07-20 22:40:44 -04:00
parent 7ca6e41462
commit 83aacbf1b5

View File

@@ -3,10 +3,10 @@ const mockGlob = jest.fn()
const mockReadFileSync = jest.fn(); const mockReadFileSync = jest.fn();
const mockStatSync = jest.fn(); const mockStatSync = jest.fn();
import { Artifact } from "../src/Artifact"; import {Artifact} from "../src/Artifact";
import { ArtifactGlobber } from "../src/ArtifactGlobber"; import {ArtifactGlobber} from "../src/ArtifactGlobber";
import { Context } from "@actions/github/lib/context"; import {Context} from "@actions/github/lib/context";
import { Inputs, CoreInputs } from "../src/Inputs"; import {Inputs, CoreInputs} from "../src/Inputs";
const artifacts = [ const artifacts = [
new Artifact('a/art1'), new Artifact('a/art1'),
@@ -14,11 +14,14 @@ const artifacts = [
] ]
jest.mock('@actions/core', () => { jest.mock('@actions/core', () => {
return { getInput: mockGetInput }; return {getInput: mockGetInput};
}) })
jest.mock('fs', () => { jest.mock('fs', () => {
return { return {
existsSync: () => {
return false
},
readFileSync: mockReadFileSync, readFileSync: mockReadFileSync,
statSync: mockStatSync statSync: mockStatSync
}; };