github-pages-deploy-action/__tests__/execute.test.ts
James Ives 109bba8860
Test Coverage Improvements (#141)
* Test Coverage Improvements

* Update env.js
2020-01-19 15:33:14 -05:00

21 lines
469 B
TypeScript

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