Skip to content

Commit

Permalink
refactor: setup context
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Feb 21, 2022
1 parent a80c8fd commit 9b58c4d
Show file tree
Hide file tree
Showing 9 changed files with 208 additions and 152 deletions.
33 changes: 33 additions & 0 deletions __tests__/goreleaser.test.ts
@@ -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('');
});
});
24 changes: 0 additions & 24 deletions __tests__/installer.test.ts

This file was deleted.

10 changes: 0 additions & 10 deletions __tests__/pro.test.ts

This file was deleted.

175 changes: 107 additions & 68 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9b58c4d

Please sign in to comment.