Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: setup context #325

Merged
merged 1 commit into from Feb 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.