mirror of
				https://github.com/actions/setup-node.git
				synced 2025-10-31 08:04:00 +08:00 
			
		
		
		
	Add and configure ESLint and update configuration for Prettier (#703)
* Add ESLinter and update Prettier * Update eslint config * Update dependencies * Rebuild action * Update package.json * Updates docs * Update docs
This commit is contained in:
		| @@ -15,11 +15,7 @@ describe('authutil tests', () => { | ||||
|   let dbgSpy: jest.SpyInstance; | ||||
|  | ||||
|   beforeAll(async () => { | ||||
|     const randPath = path.join( | ||||
|       Math.random() | ||||
|         .toString(36) | ||||
|         .substring(7) | ||||
|     ); | ||||
|     const randPath = path.join(Math.random().toString(36).substring(7)); | ||||
|     console.log('::stop-commands::stoptoken'); // Disable executing of runner commands when running tests in actions | ||||
|     process.env['GITHUB_ENV'] = ''; // Stub out Environment file functionality so we can verify it writes to standard out (toolkit is backwards compatible) | ||||
|     const tempDir = path.join(_runnerDir, randPath, 'temp'); | ||||
| @@ -67,10 +63,10 @@ describe('authutil tests', () => { | ||||
|   }, 100000); | ||||
|  | ||||
|   function readRcFile(rcFile: string) { | ||||
|     let rc = {}; | ||||
|     let contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     const rc = {}; | ||||
|     const contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     for (const line of contents.split(os.EOL)) { | ||||
|       let parts = line.split('='); | ||||
|       const parts = line.split('='); | ||||
|       if (parts.length == 2) { | ||||
|         rc[parts[0].trim()] = parts[1].trim(); | ||||
|       } | ||||
| @@ -82,8 +78,8 @@ describe('authutil tests', () => { | ||||
|     await auth.configAuthentication('https://registry.npmjs.org/', 'false'); | ||||
|  | ||||
|     expect(fs.statSync(rcFile)).toBeDefined(); | ||||
|     let contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     let rc = readRcFile(rcFile); | ||||
|     const contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     const rc = readRcFile(rcFile); | ||||
|     expect(rc['registry']).toBe('https://registry.npmjs.org/'); | ||||
|     expect(rc['always-auth']).toBe('false'); | ||||
|   }); | ||||
| @@ -92,7 +88,7 @@ describe('authutil tests', () => { | ||||
|     await auth.configAuthentication('https://registry.npmjs.org', 'false'); | ||||
|  | ||||
|     expect(fs.statSync(rcFile)).toBeDefined(); | ||||
|     let rc = readRcFile(rcFile); | ||||
|     const rc = readRcFile(rcFile); | ||||
|     expect(rc['registry']).toBe('https://registry.npmjs.org/'); | ||||
|     expect(rc['always-auth']).toBe('false'); | ||||
|   }); | ||||
| @@ -102,7 +98,7 @@ describe('authutil tests', () => { | ||||
|     await auth.configAuthentication('https://registry.npmjs.org', 'false'); | ||||
|  | ||||
|     expect(fs.statSync(rcFile)).toBeDefined(); | ||||
|     let rc = readRcFile(rcFile); | ||||
|     const rc = readRcFile(rcFile); | ||||
|     expect(rc['@myscope:registry']).toBe('https://registry.npmjs.org/'); | ||||
|     expect(rc['always-auth']).toBe('false'); | ||||
|   }); | ||||
| @@ -111,7 +107,7 @@ describe('authutil tests', () => { | ||||
|     await auth.configAuthentication('npm.pkg.github.com', 'false'); | ||||
|  | ||||
|     expect(fs.statSync(rcFile)).toBeDefined(); | ||||
|     let rc = readRcFile(rcFile); | ||||
|     const rc = readRcFile(rcFile); | ||||
|     expect(rc['@ownername:registry']).toBe('npm.pkg.github.com/'); | ||||
|     expect(rc['always-auth']).toBe('false'); | ||||
|   }); | ||||
| @@ -119,16 +115,16 @@ describe('authutil tests', () => { | ||||
|   it('Sets up npmrc for always-auth true', async () => { | ||||
|     await auth.configAuthentication('https://registry.npmjs.org/', 'true'); | ||||
|     expect(fs.statSync(rcFile)).toBeDefined(); | ||||
|     let rc = readRcFile(rcFile); | ||||
|     const rc = readRcFile(rcFile); | ||||
|     expect(rc['registry']).toBe('https://registry.npmjs.org/'); | ||||
|     expect(rc['always-auth']).toBe('true'); | ||||
|   }); | ||||
|  | ||||
|   it('It is already set the NODE_AUTH_TOKEN export it ', async () => { | ||||
|   it('is already set the NODE_AUTH_TOKEN export it', async () => { | ||||
|     process.env.NODE_AUTH_TOKEN = 'foobar'; | ||||
|     await auth.configAuthentication('npm.pkg.github.com', 'false'); | ||||
|     expect(fs.statSync(rcFile)).toBeDefined(); | ||||
|     let rc = readRcFile(rcFile); | ||||
|     const rc = readRcFile(rcFile); | ||||
|     expect(rc['@ownername:registry']).toBe('npm.pkg.github.com/'); | ||||
|     expect(rc['always-auth']).toBe('false'); | ||||
|     expect(process.env.NODE_AUTH_TOKEN).toEqual('foobar'); | ||||
| @@ -137,7 +133,7 @@ describe('authutil tests', () => { | ||||
|   it('configAuthentication should overwrite non-scoped with non-scoped', async () => { | ||||
|     fs.writeFileSync(rcFile, 'registry=NNN'); | ||||
|     await auth.configAuthentication('https://registry.npmjs.org/', 'true'); | ||||
|     let contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     const contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     expect(contents).toBe( | ||||
|       `//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}registry=https://registry.npmjs.org/${os.EOL}always-auth=true` | ||||
|     ); | ||||
| @@ -146,7 +142,7 @@ describe('authutil tests', () => { | ||||
|   it('configAuthentication should overwrite only non-scoped', async () => { | ||||
|     fs.writeFileSync(rcFile, `registry=NNN${os.EOL}@myscope:registry=MMM`); | ||||
|     await auth.configAuthentication('https://registry.npmjs.org/', 'true'); | ||||
|     let contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     const contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     expect(contents).toBe( | ||||
|       `@myscope:registry=MMM${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}registry=https://registry.npmjs.org/${os.EOL}always-auth=true` | ||||
|     ); | ||||
| @@ -155,7 +151,7 @@ describe('authutil tests', () => { | ||||
|   it('configAuthentication should add non-scoped to scoped', async () => { | ||||
|     fs.writeFileSync(rcFile, '@myscope:registry=NNN'); | ||||
|     await auth.configAuthentication('https://registry.npmjs.org/', 'true'); | ||||
|     let contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     const contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     expect(contents).toBe( | ||||
|       `@myscope:registry=NNN${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}registry=https://registry.npmjs.org/${os.EOL}always-auth=true` | ||||
|     ); | ||||
| @@ -165,7 +161,7 @@ describe('authutil tests', () => { | ||||
|     process.env['INPUT_SCOPE'] = 'myscope'; | ||||
|     fs.writeFileSync(rcFile, `@myscope:registry=NNN`); | ||||
|     await auth.configAuthentication('https://registry.npmjs.org/', 'true'); | ||||
|     let contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     const contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     expect(contents).toBe( | ||||
|       `//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/${os.EOL}always-auth=true` | ||||
|     ); | ||||
| @@ -175,7 +171,7 @@ describe('authutil tests', () => { | ||||
|     process.env['INPUT_SCOPE'] = 'myscope'; | ||||
|     fs.writeFileSync(rcFile, `registry=NNN${os.EOL}@myscope:registry=MMM`); | ||||
|     await auth.configAuthentication('https://registry.npmjs.org/', 'true'); | ||||
|     let contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     const contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     expect(contents).toBe( | ||||
|       `registry=NNN${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/${os.EOL}always-auth=true` | ||||
|     ); | ||||
| @@ -185,7 +181,7 @@ describe('authutil tests', () => { | ||||
|     process.env['INPUT_SCOPE'] = 'myscope'; | ||||
|     fs.writeFileSync(rcFile, `registry=MMM`); | ||||
|     await auth.configAuthentication('https://registry.npmjs.org/', 'true'); | ||||
|     let contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     const contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     expect(contents).toBe( | ||||
|       `registry=MMM${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/${os.EOL}always-auth=true` | ||||
|     ); | ||||
| @@ -198,7 +194,7 @@ describe('authutil tests', () => { | ||||
|       `@otherscope:registry=NNN${os.EOL}@myscope:registry=MMM` | ||||
|     ); | ||||
|     await auth.configAuthentication('https://registry.npmjs.org/', 'true'); | ||||
|     let contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     const contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     expect(contents).toBe( | ||||
|       `@otherscope:registry=NNN${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/${os.EOL}always-auth=true` | ||||
|     ); | ||||
| @@ -208,7 +204,7 @@ describe('authutil tests', () => { | ||||
|     process.env['INPUT_SCOPE'] = 'myscope'; | ||||
|     fs.writeFileSync(rcFile, `@otherscope:registry=MMM`); | ||||
|     await auth.configAuthentication('https://registry.npmjs.org/', 'true'); | ||||
|     let contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     const contents = fs.readFileSync(rcFile, {encoding: 'utf8'}); | ||||
|     expect(contents).toBe( | ||||
|       `@otherscope:registry=MMM${os.EOL}//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}${os.EOL}@myscope:registry=https://registry.npmjs.org/${os.EOL}always-auth=true` | ||||
|     ); | ||||
|   | ||||
| @@ -108,7 +108,7 @@ describe('cache-restore', () => { | ||||
|     it.each([['npm7'], ['npm6'], ['pnpm6'], ['yarn1'], ['yarn2'], ['random']])( | ||||
|       'Throw an error because %s is not supported', | ||||
|       async packageManager => { | ||||
|         await expect(restoreCache(packageManager)).rejects.toThrowError( | ||||
|         await expect(restoreCache(packageManager)).rejects.toThrow( | ||||
|           `Caching for '${packageManager}' is not supported` | ||||
|         ); | ||||
|       } | ||||
|   | ||||
| @@ -18,7 +18,7 @@ describe('run', () => { | ||||
|   const commonPath = '/some/random/path'; | ||||
|   process.env['GITHUB_WORKSPACE'] = path.join(__dirname, 'data'); | ||||
|  | ||||
|   let inputs = {} as any; | ||||
|   const inputs = {} as any; | ||||
|  | ||||
|   let getInputSpy: jest.SpyInstance; | ||||
|   let infoSpy: jest.SpyInstance; | ||||
|   | ||||
| @@ -12,11 +12,11 @@ import * as main from '../src/main'; | ||||
| import * as auth from '../src/authutil'; | ||||
| import {INodeVersion} from '../src/distributions/base-models'; | ||||
|  | ||||
| const nodeTestManifest = require('./data/versions-manifest.json'); | ||||
| const nodeTestDist = require('./data/node-dist-index.json'); | ||||
| const nodeTestDistNightly = require('./data/node-nightly-index.json'); | ||||
| const nodeTestDistRc = require('./data/node-rc-index.json'); | ||||
| const nodeV8CanaryTestDist = require('./data/v8-canary-dist-index.json'); | ||||
| import nodeTestManifest from './data/versions-manifest.json'; | ||||
| import nodeTestDist from './data/node-dist-index.json'; | ||||
| import nodeTestDistNightly from './data/node-nightly-index.json'; | ||||
| import nodeTestDistRc from './data/node-rc-index.json'; | ||||
| import nodeV8CanaryTestDist from './data/v8-canary-dist-index.json'; | ||||
|  | ||||
| describe('setup-node', () => { | ||||
|   let inputs = {} as any; | ||||
| @@ -95,13 +95,13 @@ describe('setup-node', () => { | ||||
|     getJsonSpy.mockImplementation(url => { | ||||
|       let res: any; | ||||
|       if (url.includes('/rc')) { | ||||
|         res = <INodeVersion>nodeTestDistRc; | ||||
|         res = <INodeVersion[]>nodeTestDistRc; | ||||
|       } else if (url.includes('/nightly')) { | ||||
|         res = <INodeVersion>nodeTestDistNightly; | ||||
|         res = <INodeVersion[]>nodeTestDistNightly; | ||||
|       } else if (url.includes('/v8-canary')) { | ||||
|         res = <INodeVersion>nodeV8CanaryTestDist; | ||||
|         res = <INodeVersion[]>nodeV8CanaryTestDist; | ||||
|       } else { | ||||
|         res = <INodeVersion>nodeTestDist; | ||||
|         res = <INodeVersion[]>nodeTestDist; | ||||
|       } | ||||
|  | ||||
|       return {result: res}; | ||||
| @@ -154,7 +154,7 @@ describe('setup-node', () => { | ||||
|     os['arch'] = 'x64'; | ||||
|     inputs.stable = 'true'; | ||||
|  | ||||
|     let toolPath = path.normalize( | ||||
|     const toolPath = path.normalize( | ||||
|       '/cache/node/20.0.0-v8-canary20221103f7e2421e91/x64' | ||||
|     ); | ||||
|     findSpy.mockImplementation(() => toolPath); | ||||
| @@ -180,7 +180,7 @@ describe('setup-node', () => { | ||||
|  | ||||
|     inSpy.mockImplementation(name => inputs[name]); | ||||
|  | ||||
|     let toolPath = path.normalize( | ||||
|     const toolPath = path.normalize( | ||||
|       '/cache/node/20.0.0-v8-canary20221103f7e2421e91/x64' | ||||
|     ); | ||||
|     findSpy.mockImplementation(() => toolPath); | ||||
| @@ -192,13 +192,13 @@ describe('setup-node', () => { | ||||
|     ]); | ||||
|     await main.run(); | ||||
|  | ||||
|     let expPath = path.join(toolPath, 'bin'); | ||||
|     const expPath = path.join(toolPath, 'bin'); | ||||
|     expect(cnSpy).toHaveBeenCalledWith(`::add-path::${expPath}${osm.EOL}`); | ||||
|   }); | ||||
|  | ||||
|   it('handles unhandled find error and reports error', async () => { | ||||
|     os.platform = 'linux'; | ||||
|     let errMsg = 'unhandled error message'; | ||||
|     const errMsg = 'unhandled error message'; | ||||
|     inputs['node-version'] = '20.0.0-v8-canary20221103f7e2421e91'; | ||||
|  | ||||
|     findSpy.mockImplementation(() => { | ||||
| @@ -224,7 +224,7 @@ describe('setup-node', () => { | ||||
|     os.arch = 'x64'; | ||||
|  | ||||
|     // a version which is not in the manifest but is in node dist | ||||
|     let versionSpec = '11.15.0'; | ||||
|     const versionSpec = '11.15.0'; | ||||
|  | ||||
|     inputs['node-version'] = versionSpec; | ||||
|     inputs['always-auth'] = false; | ||||
| @@ -234,13 +234,13 @@ describe('setup-node', () => { | ||||
|     findSpy.mockImplementation(() => ''); | ||||
|  | ||||
|     dlSpy.mockImplementation(async () => '/some/temp/path'); | ||||
|     let toolPath = path.normalize('/cache/node/11.11.0/x64'); | ||||
|     const toolPath = path.normalize('/cache/node/11.11.0/x64'); | ||||
|     exSpy.mockImplementation(async () => '/some/other/temp/path'); | ||||
|     cacheSpy.mockImplementation(async () => toolPath); | ||||
|  | ||||
|     await main.run(); | ||||
|  | ||||
|     let expPath = path.join(toolPath, 'bin'); | ||||
|     const expPath = path.join(toolPath, 'bin'); | ||||
|  | ||||
|     expect(dlSpy).toHaveBeenCalled(); | ||||
|     expect(exSpy).toHaveBeenCalled(); | ||||
| @@ -257,7 +257,7 @@ describe('setup-node', () => { | ||||
|     os.platform = 'linux'; | ||||
|     os.arch = 'x64'; | ||||
|  | ||||
|     let versionSpec = '23.0.0-v8-canary20221103f7e2421e91'; | ||||
|     const versionSpec = '23.0.0-v8-canary20221103f7e2421e91'; | ||||
|     inputs['node-version'] = versionSpec; | ||||
|  | ||||
|     findSpy.mockImplementation(() => ''); | ||||
| @@ -275,12 +275,12 @@ describe('setup-node', () => { | ||||
|   }); | ||||
|  | ||||
|   it('reports a failed download', async () => { | ||||
|     let errMsg = 'unhandled download message'; | ||||
|     const errMsg = 'unhandled download message'; | ||||
|     os.platform = 'linux'; | ||||
|     os.arch = 'x64'; | ||||
|  | ||||
|     // a version which is in the manifest | ||||
|     let versionSpec = '19.0.0-v8-canary'; | ||||
|     const versionSpec = '19.0.0-v8-canary'; | ||||
|  | ||||
|     inputs['node-version'] = versionSpec; | ||||
|     inputs['always-auth'] = false; | ||||
| @@ -327,14 +327,14 @@ describe('setup-node', () => { | ||||
|       inputs['always-auth'] = false; | ||||
|       inputs['token'] = 'faketoken'; | ||||
|  | ||||
|       let expectedUrl = `https://nodejs.org/download/v8-canary/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`; | ||||
|       const expectedUrl = `https://nodejs.org/download/v8-canary/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`; | ||||
|  | ||||
|       // ... but not in the local cache | ||||
|       findSpy.mockImplementation(() => ''); | ||||
|       findAllVersionsSpy.mockImplementation(() => []); | ||||
|  | ||||
|       dlSpy.mockImplementation(async () => '/some/temp/path'); | ||||
|       let toolPath = path.normalize(`/cache/node/${version}/${arch}`); | ||||
|       const toolPath = path.normalize(`/cache/node/${version}/${arch}`); | ||||
|       exSpy.mockImplementation(async () => '/some/other/temp/path'); | ||||
|       cacheSpy.mockImplementation(async () => toolPath); | ||||
|  | ||||
| @@ -502,7 +502,7 @@ describe('setup-node', () => { | ||||
|  | ||||
|   describe('setup-node v8 canary tests', () => { | ||||
|     it('v8 canary setup node flow with cached', async () => { | ||||
|       let versionSpec = 'v20-v8-canary'; | ||||
|       const versionSpec = 'v20-v8-canary'; | ||||
|  | ||||
|       inputs['node-version'] = versionSpec; | ||||
|       inputs['always-auth'] = false; | ||||
|   | ||||
							
								
								
									
										161
									
								
								__tests__/data/pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										161
									
								
								__tests__/data/pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							| @@ -7,9 +7,11 @@ dependencies: | ||||
|   express: 4.17.1 | ||||
|  | ||||
| packages: | ||||
|  | ||||
|   /accepts/1.3.7: | ||||
|     resolution: {integrity: sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== | ||||
|       } | ||||
|     engines: {node: '>= 0.6'} | ||||
|     dependencies: | ||||
|       mime-types: 2.1.31 | ||||
| @@ -21,7 +23,10 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /body-parser/1.19.0: | ||||
|     resolution: {integrity: sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== | ||||
|       } | ||||
|     engines: {node: '>= 0.8'} | ||||
|     dependencies: | ||||
|       bytes: 3.1.0 | ||||
| @@ -37,19 +42,28 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /bytes/3.1.0: | ||||
|     resolution: {integrity: sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== | ||||
|       } | ||||
|     engines: {node: '>= 0.8'} | ||||
|     dev: false | ||||
|  | ||||
|   /content-disposition/0.5.3: | ||||
|     resolution: {integrity: sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== | ||||
|       } | ||||
|     engines: {node: '>= 0.6'} | ||||
|     dependencies: | ||||
|       safe-buffer: 5.1.2 | ||||
|     dev: false | ||||
|  | ||||
|   /content-type/1.0.4: | ||||
|     resolution: {integrity: sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== | ||||
|       } | ||||
|     engines: {node: '>= 0.6'} | ||||
|     dev: false | ||||
|  | ||||
| @@ -58,12 +72,18 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /cookie/0.4.0: | ||||
|     resolution: {integrity: sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== | ||||
|       } | ||||
|     engines: {node: '>= 0.6'} | ||||
|     dev: false | ||||
|  | ||||
|   /debug/2.6.9: | ||||
|     resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== | ||||
|       } | ||||
|     dependencies: | ||||
|       ms: 2.0.0 | ||||
|     dev: false | ||||
| @@ -96,7 +116,10 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /express/4.17.1: | ||||
|     resolution: {integrity: sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== | ||||
|       } | ||||
|     engines: {node: '>= 0.10.0'} | ||||
|     dependencies: | ||||
|       accepts: 1.3.7 | ||||
| @@ -132,7 +155,10 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /finalhandler/1.1.2: | ||||
|     resolution: {integrity: sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== | ||||
|       } | ||||
|     engines: {node: '>= 0.8'} | ||||
|     dependencies: | ||||
|       debug: 2.6.9 | ||||
| @@ -145,7 +171,10 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /forwarded/0.2.0: | ||||
|     resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== | ||||
|       } | ||||
|     engines: {node: '>= 0.6'} | ||||
|     dev: false | ||||
|  | ||||
| @@ -155,7 +184,10 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /http-errors/1.7.2: | ||||
|     resolution: {integrity: sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== | ||||
|       } | ||||
|     engines: {node: '>= 0.6'} | ||||
|     dependencies: | ||||
|       depd: 1.1.2 | ||||
| @@ -166,7 +198,10 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /http-errors/1.7.3: | ||||
|     resolution: {integrity: sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== | ||||
|       } | ||||
|     engines: {node: '>= 0.6'} | ||||
|     dependencies: | ||||
|       depd: 1.1.2 | ||||
| @@ -177,7 +212,10 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /iconv-lite/0.4.24: | ||||
|     resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== | ||||
|       } | ||||
|     engines: {node: '>=0.10.0'} | ||||
|     dependencies: | ||||
|       safer-buffer: 2.1.2 | ||||
| @@ -188,11 +226,17 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /inherits/2.0.4: | ||||
|     resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== | ||||
|       } | ||||
|     dev: false | ||||
|  | ||||
|   /ipaddr.js/1.9.1: | ||||
|     resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== | ||||
|       } | ||||
|     engines: {node: '>= 0.10'} | ||||
|     dev: false | ||||
|  | ||||
| @@ -211,19 +255,28 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /mime-db/1.48.0: | ||||
|     resolution: {integrity: sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ== | ||||
|       } | ||||
|     engines: {node: '>= 0.6'} | ||||
|     dev: false | ||||
|  | ||||
|   /mime-types/2.1.31: | ||||
|     resolution: {integrity: sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg== | ||||
|       } | ||||
|     engines: {node: '>= 0.6'} | ||||
|     dependencies: | ||||
|       mime-db: 1.48.0 | ||||
|     dev: false | ||||
|  | ||||
|   /mime/1.6.0: | ||||
|     resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== | ||||
|       } | ||||
|     engines: {node: '>=4'} | ||||
|     hasBin: true | ||||
|     dev: false | ||||
| @@ -233,11 +286,17 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /ms/2.1.1: | ||||
|     resolution: {integrity: sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== | ||||
|       } | ||||
|     dev: false | ||||
|  | ||||
|   /negotiator/0.6.2: | ||||
|     resolution: {integrity: sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== | ||||
|       } | ||||
|     engines: {node: '>= 0.6'} | ||||
|     dev: false | ||||
|  | ||||
| @@ -249,7 +308,10 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /parseurl/1.3.3: | ||||
|     resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== | ||||
|       } | ||||
|     engines: {node: '>= 0.8'} | ||||
|     dev: false | ||||
|  | ||||
| @@ -258,7 +320,10 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /proxy-addr/2.0.7: | ||||
|     resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== | ||||
|       } | ||||
|     engines: {node: '>= 0.10'} | ||||
|     dependencies: | ||||
|       forwarded: 0.2.0 | ||||
| @@ -266,17 +331,26 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /qs/6.7.0: | ||||
|     resolution: {integrity: sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== | ||||
|       } | ||||
|     engines: {node: '>=0.6'} | ||||
|     dev: false | ||||
|  | ||||
|   /range-parser/1.2.1: | ||||
|     resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== | ||||
|       } | ||||
|     engines: {node: '>= 0.6'} | ||||
|     dev: false | ||||
|  | ||||
|   /raw-body/2.4.0: | ||||
|     resolution: {integrity: sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== | ||||
|       } | ||||
|     engines: {node: '>= 0.8'} | ||||
|     dependencies: | ||||
|       bytes: 3.1.0 | ||||
| @@ -286,15 +360,24 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /safe-buffer/5.1.2: | ||||
|     resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== | ||||
|       } | ||||
|     dev: false | ||||
|  | ||||
|   /safer-buffer/2.1.2: | ||||
|     resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== | ||||
|       } | ||||
|     dev: false | ||||
|  | ||||
|   /send/0.17.1: | ||||
|     resolution: {integrity: sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== | ||||
|       } | ||||
|     engines: {node: '>= 0.8.0'} | ||||
|     dependencies: | ||||
|       debug: 2.6.9 | ||||
| @@ -313,7 +396,10 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /serve-static/1.14.1: | ||||
|     resolution: {integrity: sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== | ||||
|       } | ||||
|     engines: {node: '>= 0.8.0'} | ||||
|     dependencies: | ||||
|       encodeurl: 1.0.2 | ||||
| @@ -323,7 +409,10 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /setprototypeof/1.1.1: | ||||
|     resolution: {integrity: sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== | ||||
|       } | ||||
|     dev: false | ||||
|  | ||||
|   /statuses/1.5.0: | ||||
| @@ -332,12 +421,18 @@ packages: | ||||
|     dev: false | ||||
|  | ||||
|   /toidentifier/1.0.0: | ||||
|     resolution: {integrity: sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== | ||||
|       } | ||||
|     engines: {node: '>=0.6'} | ||||
|     dev: false | ||||
|  | ||||
|   /type-is/1.6.18: | ||||
|     resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} | ||||
|     resolution: | ||||
|       { | ||||
|         integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== | ||||
|       } | ||||
|     engines: {node: '>= 0.6'} | ||||
|     dependencies: | ||||
|       media-typer: 0.3.0 | ||||
|   | ||||
| @@ -266,7 +266,7 @@ describe('main tests', () => { | ||||
|  | ||||
|       inSpy.mockImplementation(name => inputs[name]); | ||||
|  | ||||
|       let toolPath = path.normalize('/cache/node/12.16.1/x64'); | ||||
|       const toolPath = path.normalize('/cache/node/12.16.1/x64'); | ||||
|       findSpy.mockImplementation(() => toolPath); | ||||
|  | ||||
|       // expect(logSpy).toHaveBeenCalledWith(`Found in cache @ ${toolPath}`); | ||||
| @@ -286,7 +286,7 @@ describe('main tests', () => { | ||||
|  | ||||
|       inSpy.mockImplementation(name => inputs[name]); | ||||
|  | ||||
|       let toolPath = path.normalize('/cache/node/12.16.1/x64'); | ||||
|       const toolPath = path.normalize('/cache/node/12.16.1/x64'); | ||||
|       findSpy.mockImplementation(() => toolPath); | ||||
|  | ||||
|       // expect(logSpy).toHaveBeenCalledWith(`Found in cache @ ${toolPath}`); | ||||
|   | ||||
| @@ -12,11 +12,11 @@ import * as main from '../src/main'; | ||||
| import * as auth from '../src/authutil'; | ||||
| import {INodeVersion} from '../src/distributions/base-models'; | ||||
|  | ||||
| const nodeTestManifest = require('./data/versions-manifest.json'); | ||||
| const nodeTestDist = require('./data/node-dist-index.json'); | ||||
| const nodeTestDistNightly = require('./data/node-nightly-index.json'); | ||||
| const nodeTestDistRc = require('./data/node-rc-index.json'); | ||||
| const nodeV8CanaryTestDist = require('./data/v8-canary-dist-index.json'); | ||||
| import nodeTestManifest from './data/versions-manifest.json'; | ||||
| import nodeTestDist from './data/node-dist-index.json'; | ||||
| import nodeTestDistNightly from './data/node-nightly-index.json'; | ||||
| import nodeTestDistRc from './data/node-rc-index.json'; | ||||
| import nodeV8CanaryTestDist from './data/v8-canary-dist-index.json'; | ||||
|  | ||||
| describe('setup-node', () => { | ||||
|   let inputs = {} as any; | ||||
| @@ -89,11 +89,11 @@ describe('setup-node', () => { | ||||
|     getJsonSpy.mockImplementation(url => { | ||||
|       let res: any; | ||||
|       if (url.includes('/rc')) { | ||||
|         res = <INodeVersion>nodeTestDistRc; | ||||
|         res = <INodeVersion[]>nodeTestDistRc; | ||||
|       } else if (url.includes('/nightly')) { | ||||
|         res = <INodeVersion>nodeTestDistNightly; | ||||
|         res = <INodeVersion[]>nodeTestDistNightly; | ||||
|       } else { | ||||
|         res = <INodeVersion>nodeTestDist; | ||||
|         res = <INodeVersion[]>nodeTestDist; | ||||
|       } | ||||
|  | ||||
|       return {result: res}; | ||||
| @@ -146,7 +146,7 @@ describe('setup-node', () => { | ||||
|     os['arch'] = 'x64'; | ||||
|     inputs.stable = 'true'; | ||||
|  | ||||
|     let toolPath = path.normalize( | ||||
|     const toolPath = path.normalize( | ||||
|       '/cache/node/16.0.0-nightly20210417bc31dc0e0f/x64' | ||||
|     ); | ||||
|     findSpy.mockImplementation(() => toolPath); | ||||
| @@ -172,7 +172,7 @@ describe('setup-node', () => { | ||||
|     os['arch'] = 'x64'; | ||||
|     inputs.stable = 'false'; | ||||
|  | ||||
|     let toolPath = path.normalize( | ||||
|     const toolPath = path.normalize( | ||||
|       '/cache/node/16.0.0-nightly20210415c3a5e15ebe/x64' | ||||
|     ); | ||||
|     findSpy.mockImplementation(() => toolPath); | ||||
| @@ -199,7 +199,7 @@ describe('setup-node', () => { | ||||
|  | ||||
|     inSpy.mockImplementation(name => inputs[name]); | ||||
|  | ||||
|     let toolPath = path.normalize( | ||||
|     const toolPath = path.normalize( | ||||
|       '/cache/node/16.0.0-nightly20210417bc31dc0e0f/x64' | ||||
|     ); | ||||
|     findSpy.mockImplementation(() => toolPath); | ||||
| @@ -218,12 +218,12 @@ describe('setup-node', () => { | ||||
|       'x64' | ||||
|     ); | ||||
|  | ||||
|     let expPath = path.join(toolPath, 'bin'); | ||||
|     const expPath = path.join(toolPath, 'bin'); | ||||
|     expect(cnSpy).toHaveBeenCalledWith(`::add-path::${expPath}${osm.EOL}`); | ||||
|   }); | ||||
|  | ||||
|   it('handles unhandled find error and reports error', async () => { | ||||
|     let errMsg = 'unhandled error message'; | ||||
|     const errMsg = 'unhandled error message'; | ||||
|     inputs['node-version'] = '16.0.0-nightly20210417bc31dc0e0f'; | ||||
|  | ||||
|     findAllVersionsSpy.mockImplementation(() => [ | ||||
| @@ -247,7 +247,7 @@ describe('setup-node', () => { | ||||
|     os.arch = 'x64'; | ||||
|  | ||||
|     // a version which is not in the manifest but is in node dist | ||||
|     let versionSpec = '13.13.1-nightly20200415947ddec091'; | ||||
|     const versionSpec = '13.13.1-nightly20200415947ddec091'; | ||||
|  | ||||
|     inputs['node-version'] = versionSpec; | ||||
|     inputs['always-auth'] = false; | ||||
| @@ -258,7 +258,7 @@ describe('setup-node', () => { | ||||
|     findAllVersionsSpy.mockImplementation(() => []); | ||||
|  | ||||
|     dlSpy.mockImplementation(async () => '/some/temp/path'); | ||||
|     let toolPath = path.normalize( | ||||
|     const toolPath = path.normalize( | ||||
|       '/cache/node/13.13.1-nightly20200415947ddec091/x64' | ||||
|     ); | ||||
|     exSpy.mockImplementation(async () => '/some/other/temp/path'); | ||||
| @@ -266,7 +266,7 @@ describe('setup-node', () => { | ||||
|  | ||||
|     await main.run(); | ||||
|  | ||||
|     let expPath = path.join(toolPath, 'bin'); | ||||
|     const expPath = path.join(toolPath, 'bin'); | ||||
|  | ||||
|     expect(dlSpy).toHaveBeenCalled(); | ||||
|     expect(exSpy).toHaveBeenCalled(); | ||||
| @@ -277,7 +277,7 @@ describe('setup-node', () => { | ||||
|     os.platform = 'linux'; | ||||
|     os.arch = 'x64'; | ||||
|  | ||||
|     let versionSpec = '10.13.1-nightly20200415947ddec091'; | ||||
|     const versionSpec = '10.13.1-nightly20200415947ddec091'; | ||||
|     inputs['node-version'] = versionSpec; | ||||
|  | ||||
|     findSpy.mockImplementation(() => ''); | ||||
| @@ -290,12 +290,12 @@ describe('setup-node', () => { | ||||
|   }); | ||||
|  | ||||
|   it('reports a failed download', async () => { | ||||
|     let errMsg = 'unhandled download message'; | ||||
|     const errMsg = 'unhandled download message'; | ||||
|     os.platform = 'linux'; | ||||
|     os.arch = 'x64'; | ||||
|  | ||||
|     // a version which is in the manifest | ||||
|     let versionSpec = '18.0.0-nightly202204180699150267'; | ||||
|     const versionSpec = '18.0.0-nightly202204180699150267'; | ||||
|  | ||||
|     inputs['node-version'] = versionSpec; | ||||
|     inputs['always-auth'] = false; | ||||
| @@ -339,14 +339,14 @@ describe('setup-node', () => { | ||||
|       inputs['always-auth'] = false; | ||||
|       inputs['token'] = 'faketoken'; | ||||
|  | ||||
|       let expectedUrl = `https://nodejs.org/download/nightly/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`; | ||||
|       const expectedUrl = `https://nodejs.org/download/nightly/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`; | ||||
|  | ||||
|       // ... but not in the local cache | ||||
|       findSpy.mockImplementation(() => ''); | ||||
|       findAllVersionsSpy.mockImplementation(() => []); | ||||
|  | ||||
|       dlSpy.mockImplementation(async () => '/some/temp/path'); | ||||
|       let toolPath = path.normalize(`/cache/node/${version}/${arch}`); | ||||
|       const toolPath = path.normalize(`/cache/node/${version}/${arch}`); | ||||
|       exSpy.mockImplementation(async () => '/some/other/temp/path'); | ||||
|       cacheSpy.mockImplementation(async () => toolPath); | ||||
|  | ||||
|   | ||||
| @@ -13,11 +13,11 @@ import * as auth from '../src/authutil'; | ||||
| import OfficialBuilds from '../src/distributions/official_builds/official_builds'; | ||||
| import {INodeVersion} from '../src/distributions/base-models'; | ||||
|  | ||||
| const nodeTestManifest = require('./data/versions-manifest.json'); | ||||
| const nodeTestDist = require('./data/node-dist-index.json'); | ||||
| const nodeTestDistNightly = require('./data/node-nightly-index.json'); | ||||
| const nodeTestDistRc = require('./data/node-rc-index.json'); | ||||
| const nodeV8CanaryTestDist = require('./data/v8-canary-dist-index.json'); | ||||
| import nodeTestManifest from './data/versions-manifest.json'; | ||||
| import nodeTestDist from './data/node-dist-index.json'; | ||||
| import nodeTestDistNightly from './data/node-nightly-index.json'; | ||||
| import nodeTestDistRc from './data/node-rc-index.json'; | ||||
| import nodeV8CanaryTestDist from './data/v8-canary-dist-index.json'; | ||||
|  | ||||
| describe('setup-node', () => { | ||||
|   let build: OfficialBuilds; | ||||
| @@ -95,11 +95,11 @@ describe('setup-node', () => { | ||||
|     getJsonSpy.mockImplementation(url => { | ||||
|       let res: any; | ||||
|       if (url.includes('/rc')) { | ||||
|         res = <INodeVersion>nodeTestDistRc; | ||||
|         res = <INodeVersion[]>nodeTestDistRc; | ||||
|       } else if (url.includes('/nightly')) { | ||||
|         res = <INodeVersion>nodeTestDistNightly; | ||||
|         res = <INodeVersion[]>nodeTestDistNightly; | ||||
|       } else { | ||||
|         res = <INodeVersion>nodeTestDist; | ||||
|         res = <INodeVersion[]>nodeTestDist; | ||||
|       } | ||||
|  | ||||
|       return {result: res}; | ||||
| @@ -156,13 +156,13 @@ describe('setup-node', () => { | ||||
|     async (versionSpec, platform, expectedVersion, expectedLts) => { | ||||
|       os.platform = platform; | ||||
|       os.arch = 'x64'; | ||||
|       let versions: tc.IToolRelease[] | null = await tc.getManifestFromRepo( | ||||
|       const versions: tc.IToolRelease[] | null = await tc.getManifestFromRepo( | ||||
|         'actions', | ||||
|         'node-versions', | ||||
|         'mocktoken' | ||||
|       ); | ||||
|       expect(versions).toBeDefined(); | ||||
|       let match = await tc.findFromManifest(versionSpec, true, versions); | ||||
|       const match = await tc.findFromManifest(versionSpec, true, versions); | ||||
|       expect(match).toBeDefined(); | ||||
|       expect(match?.version).toBe(expectedVersion); | ||||
|       expect((match as any).lts).toBe(expectedLts); | ||||
| @@ -177,7 +177,7 @@ describe('setup-node', () => { | ||||
|     inputs['node-version'] = '12'; | ||||
|     inputs.stable = 'true'; | ||||
|  | ||||
|     let toolPath = path.normalize('/cache/node/12.16.1/x64'); | ||||
|     const toolPath = path.normalize('/cache/node/12.16.1/x64'); | ||||
|     findSpy.mockImplementation(() => toolPath); | ||||
|     await main.run(); | ||||
|  | ||||
| @@ -189,7 +189,7 @@ describe('setup-node', () => { | ||||
|  | ||||
|     inSpy.mockImplementation(name => inputs[name]); | ||||
|  | ||||
|     let toolPath = path.normalize('/cache/node/12.16.1/x64'); | ||||
|     const toolPath = path.normalize('/cache/node/12.16.1/x64'); | ||||
|     findSpy.mockImplementation(() => toolPath); | ||||
|     await main.run(); | ||||
|  | ||||
| @@ -201,16 +201,16 @@ describe('setup-node', () => { | ||||
|  | ||||
|     inSpy.mockImplementation(name => inputs[name]); | ||||
|  | ||||
|     let toolPath = path.normalize('/cache/node/12.16.1/x64'); | ||||
|     const toolPath = path.normalize('/cache/node/12.16.1/x64'); | ||||
|     findSpy.mockImplementation(() => toolPath); | ||||
|     await main.run(); | ||||
|  | ||||
|     let expPath = path.join(toolPath, 'bin'); | ||||
|     const expPath = path.join(toolPath, 'bin'); | ||||
|     expect(cnSpy).toHaveBeenCalledWith(`::add-path::${expPath}${osm.EOL}`); | ||||
|   }); | ||||
|  | ||||
|   it('handles unhandled find error and reports error', async () => { | ||||
|     let errMsg = 'unhandled error message'; | ||||
|     const errMsg = 'unhandled error message'; | ||||
|     inputs['node-version'] = '12'; | ||||
|  | ||||
|     findSpy.mockImplementation(() => { | ||||
| @@ -231,27 +231,27 @@ describe('setup-node', () => { | ||||
|     os.arch = 'x64'; | ||||
|  | ||||
|     // a version which is in the manifest | ||||
|     let versionSpec = '12.16.2'; | ||||
|     let resolvedVersion = versionSpec; | ||||
|     const versionSpec = '12.16.2'; | ||||
|     const resolvedVersion = versionSpec; | ||||
|  | ||||
|     inputs['node-version'] = versionSpec; | ||||
|     inputs['always-auth'] = false; | ||||
|     inputs['token'] = 'faketoken'; | ||||
|  | ||||
|     let expectedUrl = | ||||
|     const expectedUrl = | ||||
|       'https://github.com/actions/node-versions/releases/download/12.16.2-20200507.95/node-12.16.2-linux-x64.tar.gz'; | ||||
|  | ||||
|     // ... but not in the local cache | ||||
|     findSpy.mockImplementation(() => ''); | ||||
|  | ||||
|     dlSpy.mockImplementation(async () => '/some/temp/path'); | ||||
|     let toolPath = path.normalize('/cache/node/12.16.2/x64'); | ||||
|     const toolPath = path.normalize('/cache/node/12.16.2/x64'); | ||||
|     exSpy.mockImplementation(async () => '/some/other/temp/path'); | ||||
|     cacheSpy.mockImplementation(async () => toolPath); | ||||
|  | ||||
|     await main.run(); | ||||
|  | ||||
|     let expPath = path.join(toolPath, 'bin'); | ||||
|     const expPath = path.join(toolPath, 'bin'); | ||||
|  | ||||
|     expect(getExecOutputSpy).toHaveBeenCalledWith( | ||||
|       'node', | ||||
| @@ -284,7 +284,7 @@ describe('setup-node', () => { | ||||
|     os.arch = 'x64'; | ||||
|  | ||||
|     // a version which is not in the manifest but is in node dist | ||||
|     let versionSpec = '11.15.0'; | ||||
|     const versionSpec = '11.15.0'; | ||||
|  | ||||
|     inputs['node-version'] = versionSpec; | ||||
|     inputs['always-auth'] = false; | ||||
| @@ -318,7 +318,7 @@ describe('setup-node', () => { | ||||
|     os.platform = 'linux'; | ||||
|     os.arch = 'x64'; | ||||
|  | ||||
|     let versionSpec = '9.99.9'; | ||||
|     const versionSpec = '9.99.9'; | ||||
|     inputs['node-version'] = versionSpec; | ||||
|  | ||||
|     findSpy.mockImplementation(() => ''); | ||||
| @@ -336,13 +336,13 @@ describe('setup-node', () => { | ||||
|   }); | ||||
|  | ||||
|   it('reports a failed download', async () => { | ||||
|     let errMsg = 'unhandled download message'; | ||||
|     const errMsg = 'unhandled download message'; | ||||
|     os.platform = 'linux'; | ||||
|     os.arch = 'x64'; | ||||
|  | ||||
|     // a version which is in the manifest | ||||
|     let versionSpec = '12.16.2'; | ||||
|     let resolvedVersion = versionSpec; | ||||
|     const versionSpec = '12.16.2'; | ||||
|     const resolvedVersion = versionSpec; | ||||
|  | ||||
|     inputs['node-version'] = versionSpec; | ||||
|     inputs['always-auth'] = false; | ||||
| @@ -376,7 +376,7 @@ describe('setup-node', () => { | ||||
|       inputs['always-auth'] = false; | ||||
|       inputs['token'] = 'faketoken'; | ||||
|  | ||||
|       let expectedUrl = | ||||
|       const expectedUrl = | ||||
|         arch === 'x64' | ||||
|           ? `https://github.com/actions/node-versions/releases/download/${version}/node-${version}-${platform}-${arch}.zip` | ||||
|           : `https://nodejs.org/dist/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`; | ||||
| @@ -385,7 +385,7 @@ describe('setup-node', () => { | ||||
|       findSpy.mockImplementation(() => ''); | ||||
|  | ||||
|       dlSpy.mockImplementation(async () => '/some/temp/path'); | ||||
|       let toolPath = path.normalize(`/cache/node/${version}/${arch}`); | ||||
|       const toolPath = path.normalize(`/cache/node/${version}/${arch}`); | ||||
|       exSpy.mockImplementation(async () => '/some/other/temp/path'); | ||||
|       cacheSpy.mockImplementation(async () => toolPath); | ||||
|  | ||||
| @@ -481,7 +481,7 @@ describe('setup-node', () => { | ||||
|       os.arch = 'x64'; | ||||
|  | ||||
|       // a version which is not in the manifest but is in node dist | ||||
|       let versionSpec = '11'; | ||||
|       const versionSpec = '11'; | ||||
|  | ||||
|       inputs['node-version'] = versionSpec; | ||||
|       inputs['check-latest'] = 'true'; | ||||
| @@ -492,13 +492,13 @@ describe('setup-node', () => { | ||||
|       findSpy.mockImplementation(() => ''); | ||||
|  | ||||
|       dlSpy.mockImplementation(async () => '/some/temp/path'); | ||||
|       let toolPath = path.normalize('/cache/node/11.11.0/x64'); | ||||
|       const toolPath = path.normalize('/cache/node/11.11.0/x64'); | ||||
|       exSpy.mockImplementation(async () => '/some/other/temp/path'); | ||||
|       cacheSpy.mockImplementation(async () => toolPath); | ||||
|  | ||||
|       await main.run(); | ||||
|  | ||||
|       let expPath = path.join(toolPath, 'bin'); | ||||
|       const expPath = path.join(toolPath, 'bin'); | ||||
|  | ||||
|       expect(dlSpy).toHaveBeenCalled(); | ||||
|       expect(exSpy).toHaveBeenCalled(); | ||||
| @@ -523,7 +523,7 @@ describe('setup-node', () => { | ||||
|       os.arch = 'x64'; | ||||
|  | ||||
|       // a version which is not in the manifest but is in node dist | ||||
|       let versionSpec = '12'; | ||||
|       const versionSpec = '12'; | ||||
|  | ||||
|       inputs['node-version'] = versionSpec; | ||||
|       inputs['check-latest'] = 'true'; | ||||
| @@ -537,13 +537,13 @@ describe('setup-node', () => { | ||||
|       }); | ||||
|  | ||||
|       dlSpy.mockImplementation(async () => '/some/temp/path'); | ||||
|       let toolPath = path.normalize('/cache/node/12.11.0/x64'); | ||||
|       const toolPath = path.normalize('/cache/node/12.11.0/x64'); | ||||
|       exSpy.mockImplementation(async () => '/some/other/temp/path'); | ||||
|       cacheSpy.mockImplementation(async () => toolPath); | ||||
|  | ||||
|       await main.run(); | ||||
|  | ||||
|       let expPath = path.join(toolPath, 'bin'); | ||||
|       const expPath = path.join(toolPath, 'bin'); | ||||
|  | ||||
|       expect(dlSpy).toHaveBeenCalled(); | ||||
|       expect(exSpy).toHaveBeenCalled(); | ||||
|   | ||||
| @@ -1,10 +1,12 @@ | ||||
| import tscMatcher from '../.github/tsc.json'; | ||||
|  | ||||
| describe('problem matcher tests', () => { | ||||
|   it('tsc: matches TypeScript "pretty" error message', () => { | ||||
|     const [ | ||||
|       { | ||||
|         pattern: [{regexp}] | ||||
|       } | ||||
|     ] = require('../.github/tsc.json').problemMatcher; | ||||
|     ] = tscMatcher.problemMatcher; | ||||
|     const exampleErrorMessage = | ||||
|       "lib/index.js:23:42 - error TS2345: Argument of type 'A' is not assignable to parameter of type 'B'."; | ||||
|  | ||||
| @@ -25,7 +27,7 @@ describe('problem matcher tests', () => { | ||||
|       { | ||||
|         pattern: [{regexp}] | ||||
|       } | ||||
|     ] = require('../.github/tsc.json').problemMatcher; | ||||
|     ] = tscMatcher.problemMatcher; | ||||
|     const exampleErrorMessage = | ||||
|       "lib/index.js(23,42): error TS2345: Argument of type 'A' is not assignable to parameter of type 'B'."; | ||||
|  | ||||
|   | ||||
| @@ -12,10 +12,10 @@ import * as main from '../src/main'; | ||||
| import * as auth from '../src/authutil'; | ||||
| import {INodeVersion} from '../src/distributions/base-models'; | ||||
|  | ||||
| const nodeTestDist = require('./data/node-dist-index.json'); | ||||
| const nodeTestDistNightly = require('./data/node-nightly-index.json'); | ||||
| const nodeTestDistRc = require('./data/node-rc-index.json'); | ||||
| const nodeV8CanaryTestDist = require('./data/v8-canary-dist-index.json'); | ||||
| import nodeTestDist from './data/node-dist-index.json'; | ||||
| import nodeTestDistNightly from './data/node-nightly-index.json'; | ||||
| import nodeTestDistRc from './data/node-rc-index.json'; | ||||
| import nodeV8CanaryTestDist from './data/v8-canary-dist-index.json'; | ||||
|  | ||||
| describe('setup-node', () => { | ||||
|   let inputs = {} as any; | ||||
| @@ -86,11 +86,11 @@ describe('setup-node', () => { | ||||
|     getJsonSpy.mockImplementation(url => { | ||||
|       let res: any; | ||||
|       if (url.includes('/rc')) { | ||||
|         res = <INodeVersion>nodeTestDistRc; | ||||
|         res = <INodeVersion[]>nodeTestDistRc; | ||||
|       } else if (url.includes('/nightly')) { | ||||
|         res = <INodeVersion>nodeTestDistNightly; | ||||
|         res = <INodeVersion[]>nodeTestDistNightly; | ||||
|       } else { | ||||
|         res = <INodeVersion>nodeTestDist; | ||||
|         res = <INodeVersion[]>nodeTestDist; | ||||
|       } | ||||
|  | ||||
|       return {result: res}; | ||||
| @@ -142,7 +142,7 @@ describe('setup-node', () => { | ||||
|     inputs['node-version'] = '12.0.0-rc.1'; | ||||
|     inputs.stable = 'true'; | ||||
|  | ||||
|     let toolPath = path.normalize('/cache/node/12.0.0-rc.1/x64'); | ||||
|     const toolPath = path.normalize('/cache/node/12.0.0-rc.1/x64'); | ||||
|     findSpy.mockImplementation(() => toolPath); | ||||
|     await main.run(); | ||||
|  | ||||
| @@ -154,7 +154,7 @@ describe('setup-node', () => { | ||||
|  | ||||
|     inSpy.mockImplementation(name => inputs[name]); | ||||
|  | ||||
|     let toolPath = path.normalize('/cache/node/12.0.0-rc.1/x64'); | ||||
|     const toolPath = path.normalize('/cache/node/12.0.0-rc.1/x64'); | ||||
|     findSpy.mockImplementation(() => toolPath); | ||||
|     await main.run(); | ||||
|  | ||||
| @@ -166,16 +166,16 @@ describe('setup-node', () => { | ||||
|  | ||||
|     inSpy.mockImplementation(name => inputs[name]); | ||||
|  | ||||
|     let toolPath = path.normalize('/cache/node/12.0.0-rc.1/x64'); | ||||
|     const toolPath = path.normalize('/cache/node/12.0.0-rc.1/x64'); | ||||
|     findSpy.mockImplementation(() => toolPath); | ||||
|     await main.run(); | ||||
|  | ||||
|     let expPath = path.join(toolPath, 'bin'); | ||||
|     const expPath = path.join(toolPath, 'bin'); | ||||
|     expect(cnSpy).toHaveBeenCalledWith(`::add-path::${expPath}${osm.EOL}`); | ||||
|   }); | ||||
|  | ||||
|   it('handles unhandled find error and reports error', async () => { | ||||
|     let errMsg = 'unhandled error message'; | ||||
|     const errMsg = 'unhandled error message'; | ||||
|     inputs['node-version'] = '12.0.0-rc.1'; | ||||
|  | ||||
|     findSpy.mockImplementation(() => { | ||||
| @@ -191,7 +191,7 @@ describe('setup-node', () => { | ||||
|     os.platform = 'linux'; | ||||
|     os.arch = 'x64'; | ||||
|  | ||||
|     let versionSpec = '13.0.0-rc.0'; | ||||
|     const versionSpec = '13.0.0-rc.0'; | ||||
|  | ||||
|     inputs['node-version'] = versionSpec; | ||||
|     inputs['always-auth'] = false; | ||||
| @@ -201,13 +201,13 @@ describe('setup-node', () => { | ||||
|     findSpy.mockImplementation(() => ''); | ||||
|  | ||||
|     dlSpy.mockImplementation(async () => '/some/temp/path'); | ||||
|     let toolPath = path.normalize('/cache/node/13.0.0-rc.0/x64'); | ||||
|     const toolPath = path.normalize('/cache/node/13.0.0-rc.0/x64'); | ||||
|     exSpy.mockImplementation(async () => '/some/other/temp/path'); | ||||
|     cacheSpy.mockImplementation(async () => toolPath); | ||||
|  | ||||
|     await main.run(); | ||||
|  | ||||
|     let expPath = path.join(toolPath, 'bin'); | ||||
|     const expPath = path.join(toolPath, 'bin'); | ||||
|  | ||||
|     expect(dlSpy).toHaveBeenCalled(); | ||||
|     expect(exSpy).toHaveBeenCalled(); | ||||
| @@ -220,7 +220,7 @@ describe('setup-node', () => { | ||||
|     os.platform = 'linux'; | ||||
|     os.arch = 'x64'; | ||||
|  | ||||
|     let versionSpec = '9.99.9-rc.1'; | ||||
|     const versionSpec = '9.99.9-rc.1'; | ||||
|     inputs['node-version'] = versionSpec; | ||||
|  | ||||
|     findSpy.mockImplementation(() => ''); | ||||
| @@ -232,11 +232,11 @@ describe('setup-node', () => { | ||||
|   }); | ||||
|  | ||||
|   it('reports a failed download', async () => { | ||||
|     let errMsg = 'unhandled download message'; | ||||
|     const errMsg = 'unhandled download message'; | ||||
|     os.platform = 'linux'; | ||||
|     os.arch = 'x64'; | ||||
|  | ||||
|     let versionSpec = '14.7.0-rc.1'; | ||||
|     const versionSpec = '14.7.0-rc.1'; | ||||
|  | ||||
|     inputs['node-version'] = versionSpec; | ||||
|     inputs['always-auth'] = false; | ||||
| @@ -271,14 +271,14 @@ describe('setup-node', () => { | ||||
|       inputs['always-auth'] = false; | ||||
|       inputs['token'] = 'faketoken'; | ||||
|  | ||||
|       let expectedUrl = `https://nodejs.org/download/rc/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`; | ||||
|       const expectedUrl = `https://nodejs.org/download/rc/v${version}/node-v${version}-${platform}-${arch}.${fileExtension}`; | ||||
|  | ||||
|       // ... but not in the local cache | ||||
|       findSpy.mockImplementation(() => ''); | ||||
|       findAllVersionsSpy.mockImplementation(() => []); | ||||
|  | ||||
|       dlSpy.mockImplementation(async () => '/some/temp/path'); | ||||
|       let toolPath = path.normalize(`/cache/node/${version}/${arch}`); | ||||
|       const toolPath = path.normalize(`/cache/node/${version}/${arch}`); | ||||
|       exSpy.mockImplementation(async () => '/some/other/temp/path'); | ||||
|       cacheSpy.mockImplementation(async () => toolPath); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Ivan
					Ivan