|
|
@ -43,9 +43,10 @@ describe('installer tests', () => {
|
|
|
|
|
|
|
|
|
|
|
|
describe('the latest release of a go version', () => {
|
|
|
|
describe('the latest release of a go version', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
beforeEach(() => {
|
|
|
|
nock('https://api.github.com')
|
|
|
|
nock('https://golang.org')
|
|
|
|
.get('/repos/golang/go/git/refs/tags')
|
|
|
|
.get('/dl/')
|
|
|
|
.replyWithFile(200, path.join(dataDir, 'golang-tags.json'));
|
|
|
|
.query({mode: 'json', include: 'all'})
|
|
|
|
|
|
|
|
.replyWithFile(200, path.join(dataDir, 'golang-dl.json'));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
afterEach(() => {
|
|
|
|
afterEach(() => {
|
|
|
@ -79,7 +80,7 @@ describe('installer tests', () => {
|
|
|
|
|
|
|
|
|
|
|
|
it('Acquires latest release version of go if using 1.x and no matching version is installed', async () => {
|
|
|
|
it('Acquires latest release version of go if using 1.x and no matching version is installed', async () => {
|
|
|
|
await installer.getGo('1.x');
|
|
|
|
await installer.getGo('1.x');
|
|
|
|
const goDir = path.join(toolDir, 'go', '1.13.0-beta1', os.arch());
|
|
|
|
const goDir = path.join(toolDir, 'go', '1.13.0', os.arch());
|
|
|
|
|
|
|
|
|
|
|
|
expect(fs.existsSync(`${goDir}.complete`)).toBe(true);
|
|
|
|
expect(fs.existsSync(`${goDir}.complete`)).toBe(true);
|
|
|
|
if (IS_WINDOWS) {
|
|
|
|
if (IS_WINDOWS) {
|
|
|
|