mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
40 lines
733 B
TypeScript
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:
|
|
})
|
|
});
|
|
});
|