common base tmpDir for tests

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-02-01 14:29:53 +01:00
parent 257dd09431
commit b193ec6e9e
7 changed files with 25 additions and 12 deletions

View File

@@ -16,7 +16,6 @@
import {describe, expect, it, jest, test, beforeEach} from '@jest/globals';
import * as fs from 'fs';
import os from 'os';
import * as path from 'path';
import osm = require('os');
@@ -27,7 +26,8 @@ beforeEach(() => {
});
describe('install', () => {
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'actions-toolkit-'));
// prettier-ignore
const tmpDir = path.join(process.env.TEMP || '/tmp', 'buildx-install-jest').split(path.sep).join(path.posix.sep);
// prettier-ignore
test.each([
@@ -65,6 +65,12 @@ describe('install', () => {
},
100000
);
it('returns latest buildx GitHub release', async () => {
const release = await Install.getRelease('latest');
expect(release).not.toBeNull();
expect(release?.tag_name).not.toEqual('');
});
});
describe('getRelease', () => {