Update tests

This commit is contained in:
Rui Chen 2020-03-06 21:57:53 -05:00
parent 34b2b22dcf
commit b84de5a54c
No known key found for this signature in database
GPG key ID: 15A594F673F803E8

View file

@ -81,8 +81,8 @@ describe('setup-go', () => {
os.arch = 'x64'; os.arch = 'x64';
// get request is already mocked // get request is already mocked
// spec: 1.13.7 => 1.13.7 (exact) // spec: 1.13.8 => 1.13.8 (exact)
let match: im.IGoVersion | undefined = await im.findMatch('1.13.7', true); let match: im.IGoVersion | undefined = await im.findMatch('1.13.8', true);
expect(match).toBeDefined(); expect(match).toBeDefined();
let version: string = match ? match.version : ''; let version: string = match ? match.version : '';
expect(version).toBe('go1.13.8'); expect(version).toBe('go1.13.8');
@ -146,16 +146,16 @@ describe('setup-go', () => {
os.platform = 'linux'; os.platform = 'linux';
os.arch = 'x64'; os.arch = 'x64';
// spec: 1.14, stable=false => go1.14rc1 // spec: 1.14.1, stable=false => go1.14.1rc1
let match: im.IGoVersion | undefined = await im.findMatch( let match: im.IGoVersion | undefined = await im.findMatch(
'1.14.0-rc1', '1.14.1-rc1',
false false
); );
expect(match).toBeDefined(); expect(match).toBeDefined();
let version: string = match ? match.version : ''; let version: string = match ? match.version : '';
expect(version).toBe('go1.14rc1'); expect(version).toBe('go1.14.1rc1');
let fileName = match ? match.files[0].filename : ''; let fileName = match ? match.files[0].filename : '';
expect(fileName).toBe('go1.14rc1.linux-amd64.tar.gz'); expect(fileName).toBe('go1.14.1rc1.linux-amd64.tar.gz');
}); });
it('evaluates to stable with input as true', async () => { it('evaluates to stable with input as true', async () => {