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

19 lines
410 B
TypeScript
Raw Normal View History

2019-11-08 07:35:31 +08:00
import {execute} from '../src/util';
import {exec} from '@actions/exec';
jest.mock('@actions/exec', () => ({
exec: jest.fn()
}))
test('util - execute - should be called with the correct arguements', async() => {
await execute('echo Montezuma', './')
expect(exec).toBeCalledWith(
"echo Montezuma", [], {
cwd: "./",
listeners: {
stdout: expect.any(Function)
}
}
)
});