Skip to content

Commit

Permalink
Use built-in getExecOutput
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Jun 22, 2021
1 parent a7071c9 commit dac97ff
Show file tree
Hide file tree
Showing 6 changed files with 541 additions and 593 deletions.
11 changes: 11 additions & 0 deletions __tests__/buildx.test.ts
@@ -1,6 +1,7 @@
import * as fs from 'fs';
import * as path from 'path';
import * as semver from 'semver';
import * as exec from '@actions/exec';

import * as buildx from '../src/buildx';
import * as context from '../src/context';
Expand Down Expand Up @@ -92,6 +93,16 @@ describe('isLocalOrTarExporter', () => {
);
});

describe('isAvailable', () => {
const execSpy: jest.SpyInstance = jest.spyOn(exec, 'getExecOutput');
buildx.isAvailable();

expect(execSpy).toHaveBeenCalledWith(`docker`, ['buildx'], {
silent: true,
ignoreReturnCode: true
});
});

describe('getVersion', () => {
async function isDaemonRunning() {
return await docker.isDaemonRunning();
Expand Down

0 comments on commit dac97ff

Please sign in to comment.