mirror of
https://github.com/goreleaser/goreleaser-action
synced 2026-06-29 20:27:30 +00:00
refactor: setup context (#325)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import * as fs from 'fs';
|
||||
import * as goreleaser from '../src/goreleaser';
|
||||
|
||||
describe('install', () => {
|
||||
it('acquires v0.182.0 version of GoReleaser', async () => {
|
||||
const bin = await goreleaser.install('goreleaser', 'v0.182.0');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires latest version of GoReleaser', async () => {
|
||||
const bin = await goreleaser.install('goreleaser', 'latest');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires v0.182.0-pro version of GoReleaser Pro', async () => {
|
||||
const bin = await goreleaser.install('goreleaser-pro', 'v0.182.0-pro');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires latest version of GoReleaser Pro', async () => {
|
||||
const bin = await goreleaser.install('goreleaser-pro', 'latest');
|
||||
expect(fs.existsSync(bin)).toBe(true);
|
||||
}, 100000);
|
||||
});
|
||||
|
||||
describe('distribSuffix', () => {
|
||||
it('suffixes pro distribution', async () => {
|
||||
expect(goreleaser.distribSuffix('goreleaser-pro')).toEqual('-pro');
|
||||
});
|
||||
it('does not suffix oss distribution', async () => {
|
||||
expect(goreleaser.distribSuffix('goreleaser')).toEqual('');
|
||||
});
|
||||
});
|
||||
@@ -1,24 +0,0 @@
|
||||
import fs = require('fs');
|
||||
import * as installer from '../src/installer';
|
||||
|
||||
describe('installer', () => {
|
||||
it('acquires v0.182.0 version of GoReleaser', async () => {
|
||||
const goreleaser = await installer.getGoReleaser('goreleaser', 'v0.182.0');
|
||||
expect(fs.existsSync(goreleaser)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires latest version of GoReleaser', async () => {
|
||||
const goreleaser = await installer.getGoReleaser('goreleaser', 'latest');
|
||||
expect(fs.existsSync(goreleaser)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires v0.182.0-pro version of GoReleaser Pro', async () => {
|
||||
const goreleaser = await installer.getGoReleaser('goreleaser-pro', 'v0.182.0-pro');
|
||||
expect(fs.existsSync(goreleaser)).toBe(true);
|
||||
}, 100000);
|
||||
|
||||
it('acquires latest version of GoReleaser Pro', async () => {
|
||||
const goreleaser = await installer.getGoReleaser('goreleaser-pro', 'latest');
|
||||
expect(fs.existsSync(goreleaser)).toBe(true);
|
||||
}, 100000);
|
||||
});
|
||||
@@ -1,10 +0,0 @@
|
||||
import * as pro from '../src/pro';
|
||||
|
||||
describe('pro', () => {
|
||||
it('suffixes pro distribution', async () => {
|
||||
expect(pro.suffix('goreleaser-pro')).toEqual('-pro');
|
||||
});
|
||||
it('does not suffix oss distribution', async () => {
|
||||
expect(pro.suffix('goreleaser')).toEqual('');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user