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

23 lines
508 B
TypeScript
Raw Normal View History

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