docker: context method

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-02-25 12:20:06 +01:00
parent 2e59ae7030
commit 97e647fdd0
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');