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

feat: implement (optional) semver parsing of version #213

Merged
merged 4 commits into from Jun 15, 2020
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
2 changes: 0 additions & 2 deletions __tests__/git.test.ts
Expand Up @@ -3,15 +3,13 @@ import * as git from '../src/git';
describe('git', () => {
it('returns git tag', async () => {
const tag: string = await git.getTag();
console.log(tag);
expect(tag).not.toEqual('');
});
it('checks if tag is dirty', async () => {
expect(await git.isTagDirty('v1.3.1')).toBe(true);
});
it('returns short commit', async () => {
const commit: string = await git.getShortCommit();
console.log(commit);
expect(commit).not.toEqual('');
});
});
7 changes: 5 additions & 2 deletions __tests__/github.test.ts
Expand Up @@ -3,14 +3,17 @@ import * as github from '../src/github';
describe('github', () => {
it('returns latest GoReleaser GitHub release', async () => {
const release = await github.getRelease('latest');
console.log(release);
expect(release).not.toBeNull();
expect(release?.tag_name).not.toEqual('');
});
it('returns v0.117.0 GoReleaser GitHub release', async () => {
const release = await github.getRelease('v0.117.0');
console.log(release);
expect(release).not.toBeNull();
expect(release?.tag_name).toEqual('v0.117.0');
});
it('returns v0.132.1 GoReleaser GitHub release', async () => {
const release = await github.getRelease('~> 0.132');
expect(release).not.toBeNull();
expect(release?.tag_name).toEqual('v0.132.1');
});
});
2 changes: 0 additions & 2 deletions __tests__/installer.test.ts
Expand Up @@ -4,13 +4,11 @@ import * as installer from '../src/installer';
describe('installer', () => {
it('acquires v0.117.0 version of GoReleaser', async () => {
const goreleaser = await installer.getGoReleaser('v0.117.0');
console.log(goreleaser);
expect(fs.existsSync(goreleaser)).toBe(true);
}, 100000);

it('acquires latest version of GoReleaser', async () => {
const goreleaser = await installer.getGoReleaser('latest');
console.log(goreleaser);
expect(fs.existsSync(goreleaser)).toBe(true);
}, 100000);
});