Files
k8s-deploy/src/utilities/dockerUtils.test.ts
T
2022-06-24 16:57:45 -04:00

16 lines
524 B
TypeScript

import * as io from '@actions/io'
import {checkDockerPath} from './dockerUtils'
describe('docker utilities', () => {
it('checks if docker is installed', async () => {
// docker installed
const path = 'path'
jest.spyOn(io, 'which').mockImplementationOnce(async () => path)
expect(() => checkDockerPath()).not.toThrow()
// docker not installed
jest.spyOn(io, 'which').mockImplementationOnce(async () => undefined)
await expect(() => checkDockerPath()).rejects.toThrow()
})
})