From e62b0af47d0bde24071c38ef8df546981c968877 Mon Sep 17 00:00:00 2001 From: Sarah Oslund Date: Thu, 11 Feb 2021 15:18:33 -0800 Subject: [PATCH] Updating SDK extension tests --- vscode-dotnet-runtime-extension/index.d.ts | 6 ------ vscode-dotnet-runtime-extension/package.json | 2 +- .../src/extension.ts | 2 +- vscode-dotnet-runtime-extension/tsconfig.json | 1 + .../DotnetCoreAcquisitionExtension.test.ts | 21 ++++++++++++++++++- 5 files changed, 23 insertions(+), 9 deletions(-) delete mode 100644 vscode-dotnet-runtime-extension/index.d.ts diff --git a/vscode-dotnet-runtime-extension/index.d.ts b/vscode-dotnet-runtime-extension/index.d.ts deleted file mode 100644 index 086cd671..00000000 --- a/vscode-dotnet-runtime-extension/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* -------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - * ------------------------------------------------------------------------------------------ */ - -export * from './src/extension'; diff --git a/vscode-dotnet-runtime-extension/package.json b/vscode-dotnet-runtime-extension/package.json index 93a61b22..bf929a6f 100644 --- a/vscode-dotnet-runtime-extension/package.json +++ b/vscode-dotnet-runtime-extension/package.json @@ -34,7 +34,7 @@ "onCommand:dotnet.reportIssue" ], "main": "./dist/extension.js", - "types": "./index.d.ts", + "types": "./dist/extension.d.ts", "contributes": { "commands": [ { diff --git a/vscode-dotnet-runtime-extension/src/extension.ts b/vscode-dotnet-runtime-extension/src/extension.ts index 2a4f7145..bca1e3a4 100644 --- a/vscode-dotnet-runtime-extension/src/extension.ts +++ b/vscode-dotnet-runtime-extension/src/extension.ts @@ -41,7 +41,7 @@ namespace configKeys { export const enableTelemetry = 'enableTelemetry'; export const existingPath = 'existingDotnetPath'; } -export namespace commandKeys { +namespace commandKeys { export const acquire = 'acquire'; export const uninstallAll = 'uninstallAll'; export const showAcquisitionLog = 'showAcquisitionLog'; diff --git a/vscode-dotnet-runtime-extension/tsconfig.json b/vscode-dotnet-runtime-extension/tsconfig.json index aff4dc1f..81cca1dd 100644 --- a/vscode-dotnet-runtime-extension/tsconfig.json +++ b/vscode-dotnet-runtime-extension/tsconfig.json @@ -8,6 +8,7 @@ ], "sourceMap": true, "rootDir": "src", + "declaration": true, "strict": true /* enable all strict type-checking options */ }, "exclude": [ diff --git a/vscode-dotnet-sdk-extension/src/test/functional/DotnetCoreAcquisitionExtension.test.ts b/vscode-dotnet-sdk-extension/src/test/functional/DotnetCoreAcquisitionExtension.test.ts index c0b9b658..13c354f7 100644 --- a/vscode-dotnet-sdk-extension/src/test/functional/DotnetCoreAcquisitionExtension.test.ts +++ b/vscode-dotnet-sdk-extension/src/test/functional/DotnetCoreAcquisitionExtension.test.ts @@ -44,12 +44,13 @@ suite('DotnetCoreAcquisitionExtension End to End', function() { }); this.afterEach(async () => { + this.timeout(20000); // Tear down tmp storage for fresh run await vscode.commands.executeCommand('dotnet-sdk.uninstallAll'); mockState.clear(); MockTelemetryReporter.telemetryEvents = []; rimraf.sync(storagePath); - }).timeout(20000); + }); test('Activate', async () => { // Commands should now be registered @@ -76,4 +77,22 @@ suite('DotnetCoreAcquisitionExtension End to End', function() { await vscode.commands.executeCommand('dotnet-sdk.uninstallAll'); assert.isFalse(fs.existsSync(result!.dotnetPath)); }).timeout(100000); + + test('Install Multiple Versions', async () => { + const versions = ['3.1', '5.0']; + let dotnetPaths: string[] = []; + for (const version of versions) { + const result = await vscode.commands.executeCommand('dotnet-sdk.acquire', { version }); + assert.exists(result); + assert.exists(result!.dotnetPath); + assert.include(result!.dotnetPath, version); + if (result!.dotnetPath) { + dotnetPaths = dotnetPaths.concat(result!.dotnetPath); + } + } + // All versions are still there after all installs are completed + for (const dotnetPath of dotnetPaths) { + assert.isTrue(fs.existsSync(dotnetPath)); + } + }).timeout(600000); });