Merge pull request #56 from crazy-max/docker-context
Some checks failed
publish / publish (push) Has been cancelled

docker: context method
This commit is contained in:
CrazyMax
2023-02-25 12:24:04 +01:00
committed by GitHub
2 changed files with 25 additions and 0 deletions

View File

@@ -57,6 +57,19 @@ describe('isAvailable', () => {
});
});
describe('context', () => {
it('call docker context show', async () => {
const execSpy = jest.spyOn(Exec, 'getExecOutput');
await Docker.context().catch(() => {
// noop
});
expect(execSpy).toHaveBeenCalledWith(`docker`, ['context', 'show'], {
ignoreReturnCode: true,
silent: true
});
});
});
describe('printVersion', () => {
it('call docker version', async () => {
const execSpy = jest.spyOn(Exec, 'exec');