Skip to content

Commit

Permalink
fix tests and add log
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-shibanov committed Feb 24, 2022
1 parent 13b497a commit 657ab0b
Show file tree
Hide file tree
Showing 5 changed files with 319 additions and 843 deletions.
14 changes: 7 additions & 7 deletions __tests__/setup-go.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ describe('setup-go', () => {
findSpy.mockImplementation(() => toolPath);
await main.run();

expect(logSpy).toHaveBeenCalledWith(`Setup go stable version spec 1.13.0`);
expect(logSpy).toHaveBeenCalledWith(`Setup go version spec 1.13.0`);
});

it('evaluates to stable with no input', async () => {
Expand All @@ -227,7 +227,7 @@ describe('setup-go', () => {
findSpy.mockImplementation(() => toolPath);
await main.run();

expect(logSpy).toHaveBeenCalledWith(`Setup go stable version spec 1.13.0`);
expect(logSpy).toHaveBeenCalledWith(`Setup go version spec 1.13.0`);
});

it('finds a version of go already in the cache', async () => {
Expand Down Expand Up @@ -393,7 +393,7 @@ describe('setup-go', () => {
await main.run();

let expPath = path.join(toolPath, 'bin');
expect(logSpy).toHaveBeenCalledWith('Setup go stable version spec 1.12.14');
expect(logSpy).toHaveBeenCalledWith('Setup go version spec 1.12.14');
expect(findSpy).toHaveBeenCalled();
expect(logSpy).toHaveBeenCalledWith('Attempting to download 1.12.14...');
expect(dlSpy).toHaveBeenCalled();
Expand Down Expand Up @@ -557,8 +557,8 @@ describe('setup-go', () => {

// 1.13.1 => 1.13.1
// 1.13 => 1.13.0
// 1.10beta1 => 1.10.0-beta1, 1.10rc1 => 1.10.0-rc1
// 1.8.5beta1 => 1.8.5-beta1, 1.8.5rc1 => 1.8.5-rc1
// 1.10beta1 => 1.10.0-beta.1, 1.10rc1 => 1.10.0-rc.1
// 1.8.5beta1 => 1.8.5-beta.1, 1.8.5rc1 => 1.8.5-rc.1
it('converts prerelease versions', async () => {
expect(im.makeSemver('1.10beta1')).toBe('1.10.0-beta.1');
expect(im.makeSemver('1.10rc1')).toBe('1.10.0-rc.1');
Expand Down Expand Up @@ -605,7 +605,7 @@ describe('setup-go', () => {

await main.run();

expect(logSpy).toHaveBeenCalledWith('Setup go stable version spec 1.16');
expect(logSpy).toHaveBeenCalledWith('Setup go version spec 1.16');
expect(logSpy).toHaveBeenCalledWith(`Found in cache @ ${toolPath}`);
});

Expand All @@ -630,7 +630,7 @@ describe('setup-go', () => {
await main.run();

expect(logSpy).toHaveBeenCalledWith(
`Setup go stable version spec ${versionSpec}`
`Setup go version spec ${versionSpec}`
);
expect(logSpy).toHaveBeenCalledWith(
'Attempting to resolve the latest version from the manifest...'
Expand Down
3 changes: 0 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ inputs:
check-latest:
description: 'Set this option to true if you want the action to always check for the latest available version that satisfies the version spec'
default: false
stable:
description: 'Whether to download only stable versions'
default: 'true'
token:
description: Used to pull node distributions from go-versions. Since there's a default, this is typically not supplied by the user.
default: ${{ github.token }}
Expand Down
Loading

0 comments on commit 657ab0b

Please sign in to comment.