docker-build-push/setup-buildx/__tests__/buildx.test.ts
CrazyMax 5bb3f5433b
Check if buildx available on runner
Use default buildx on runner

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2020-08-12 15:58:09 +02:00

24 lines
749 B
TypeScript

import fs = require('fs');
import * as buildx from '../src/buildx';
import * as path from 'path';
import * as os from 'os';
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'setup-buildx-'));
describe('buildx', () => {
it('is available', async () => {
expect(await buildx.isAvailable()).toBe(true);
}, 100000);
it('acquires v0.2.2 version of buildx', async () => {
const buildxBin = await buildx.install('v0.2.2', tmpDir);
console.log(buildxBin);
expect(fs.existsSync(buildxBin)).toBe(true);
}, 100000);
it('acquires latest version of buildx', async () => {
const buildxBin = await buildx.install('latest', tmpDir);
console.log(buildxBin);
expect(fs.existsSync(buildxBin)).toBe(true);
}, 100000);
});