github-pages-deploy-action/__tests__/execute.test.ts

20 lines
434 B
TypeScript
Raw Normal View History

import { execute } from "../src/execute";
import { exec } from "@actions/exec";
2020-01-12 09:26:08 +08:00
jest.mock("@actions/exec", () => ({
2020-01-12 09:26:08 +08:00
exec: jest.fn()
}));
2020-01-12 09:26:08 +08:00
describe("execute", () => {
it("should be called with the correct arguments", async () => {
await execute("echo Montezuma", "./");
expect(exec).toBeCalledWith("echo Montezuma", [], {
cwd: "./",
listeners: {
stdout: expect.any(Function)
}
2020-01-12 09:26:08 +08:00
});
});
});