github-pages-deploy-action/__tests__/git.test.ts
2019-11-07 19:57:58 -05:00

40 lines
733 B
TypeScript

process.env["INPUT_FOLDER"] = "build";
import { execute } from "../src/util";
import { init } from "../src/git";
import {action} from '../src/constants'
jest.mock("../src/constants", () => ({
build: 'dist',
action: {
pusher: {
name: 'montezuma',
email: 'best@cat',
},
gitHubToken: 'exists',
}
}));
jest.mock("../src/util", () => ({
execute: jest.fn()
}));
jest.mock("@actions/io", () => ({
cp: jest.fn()
}));
describe("git", () => {
describe("init", () => {
it("should execute three commands", async () => {
await init();
expect(execute).toBeCalledTimes(3);
});
it("should fail if the dpeloyment folder begins with /", async () => {
// TODO:
})
});
});