From 6643115948df817873d53950a331d3968bb87979 Mon Sep 17 00:00:00 2001 From: Zachary Eisinger Date: Tue, 22 Sep 2020 10:17:07 -0700 Subject: [PATCH] Update test name and timeout --- __tests__/installer.test.ts | 18 ------------------ __tests__/setup-dotnet.test.ts | 5 ++--- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/__tests__/installer.test.ts b/__tests__/installer.test.ts index 5945459..08c54f2 100644 --- a/__tests__/installer.test.ts +++ b/__tests__/installer.test.ts @@ -9,7 +9,6 @@ const tempDir = path.join(__dirname, 'runner', 'temp'); process.env['RUNNER_TOOL_CACHE'] = toolDir; process.env['RUNNER_TEMP'] = tempDir; -import * as setup from '../src/setup-dotnet'; import * as installer from '../src/installer'; const IS_WINDOWS = process.platform === 'win32'; @@ -42,23 +41,6 @@ describe('installer tests', () => { } }, 400000); //This needs some time to download on "slower" internet connections - it('Acquires version of dotnet from global.json if no matching version is installed', async () => { - const globalJsonPath = path.join(process.cwd(), 'global.json'); - const jsonContents = `{${os.EOL}"sdk": {${os.EOL}"version": "3.1.201"${os.EOL}}${os.EOL}}`; - if (!fs.existsSync(globalJsonPath)) { - fs.writeFileSync(globalJsonPath, jsonContents); - } - await setup.run(); - - expect(fs.existsSync(path.join(toolDir, 'sdk', '3.1.201'))).toBe(true); - if (IS_WINDOWS) { - expect(fs.existsSync(path.join(toolDir, 'dotnet.exe'))).toBe(true); - } else { - expect(fs.existsSync(path.join(toolDir, 'dotnet'))).toBe(true); - } - fs.unlinkSync(globalJsonPath); - }, 100000); - it('Acquires generic version of dotnet if no matching version is installed', async () => { await getDotnet('3.1'); var directory = fs diff --git a/__tests__/setup-dotnet.test.ts b/__tests__/setup-dotnet.test.ts index d7be6e4..c492f56 100644 --- a/__tests__/setup-dotnet.test.ts +++ b/__tests__/setup-dotnet.test.ts @@ -29,7 +29,7 @@ describe('setup-dotnet tests', () => { } }, 30000); - it('Acquires version of dotnet if no matching version is installed', async () => { + it('Acquires version of dotnet from global.json if no matching version is installed', async () => { const globalJsonPath = path.join(process.cwd(), 'global.json'); const jsonContents = `{${os.EOL}"sdk": {${os.EOL}"version": "3.1.201"${os.EOL}}${os.EOL}}`; if (!fs.existsSync(globalJsonPath)) { @@ -43,6 +43,5 @@ describe('setup-dotnet tests', () => { } else { expect(fs.existsSync(path.join(toolDir, 'dotnet'))).toBe(true); } - fs.unlinkSync(globalJsonPath); - }, 100000); + }, 400000); });