diff --git a/test/index.ts b/test/index.ts deleted file mode 100644 index 8ff1de2e82..0000000000 --- a/test/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -let testRunner = require("vscode/lib/testrunner"); - -// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for options -testRunner.configure({ - ui: "tdd", // the TDD UI is being used in extension.test.ts (suite, test, etc.) - useColors: true, // colored output from test results -}); - -module.exports = testRunner; diff --git a/test/platform.test.ts b/test/platform.test.ts deleted file mode 100644 index b13cb303ae..0000000000 --- a/test/platform.test.ts +++ /dev/null @@ -1,121 +0,0 @@ -/*--------------------------------------------------------- - * Copyright (C) Microsoft Corporation. All rights reserved. - *--------------------------------------------------------*/ - -import * as assert from "assert"; -import * as vscode from "vscode"; -import * as platform from "../src/platform"; - -function checkDefaultPowerShellPath(platformDetails, expectedPath) { - test("returns correct default path", () => { - assert.equal( - platform.getDefaultPowerShellPath(platformDetails), - expectedPath); - }); -} - -function checkAvailableWindowsPowerShellPaths( - platformDetails: platform.IPlatformDetails, - expectedPaths: platform.IPowerShellExeDetails[]) { - test("correctly enumerates available Windows PowerShell paths", () => { - - // The system may return PowerShell Core paths so only - // enumerate the first list items. - const enumeratedPaths = platform.getAvailablePowerShellExes(platformDetails, undefined); - for (let i; i < expectedPaths.length; i++) { - assert.equal(enumeratedPaths[i], expectedPaths[i]); - } - }); -} - -function checkFixedWindowsPowerShellpath(platformDetails, inputPath, expectedPath) { - test("fixes incorrect Windows PowerShell Sys* path", () => { - assert.equal( - platform.fixWindowsPowerShellPath(inputPath, platformDetails), - expectedPath); - }); -} - -suite("Platform module", () => { - - suite("64-bit Windows, 64-bit VS Code", () => { - const platformDetails: platform.IPlatformDetails = { - operatingSystem: platform.OperatingSystem.Windows, - isOS64Bit: true, - isProcess64Bit: true, - }; - - checkDefaultPowerShellPath( - platformDetails, - platform.System32PowerShellPath); - - checkAvailableWindowsPowerShellPaths( - platformDetails, - [ - { - versionName: platform.WindowsPowerShell64BitLabel, - exePath: platform.System32PowerShellPath, - }, - { - versionName: platform.WindowsPowerShell32BitLabel, - exePath: platform.SysWow64PowerShellPath, - }, - ]); - - checkFixedWindowsPowerShellpath( - platformDetails, - platform.SysnativePowerShellPath, - platform.System32PowerShellPath); - }); - - suite("64-bit Windows, 32-bit VS Code", () => { - const platformDetails: platform.IPlatformDetails = { - operatingSystem: platform.OperatingSystem.Windows, - isOS64Bit: true, - isProcess64Bit: false, - }; - - checkDefaultPowerShellPath( - platformDetails, - platform.SysnativePowerShellPath); - - checkAvailableWindowsPowerShellPaths( - platformDetails, - [ - { - versionName: platform.WindowsPowerShell64BitLabel, - exePath: platform.SysnativePowerShellPath, - }, - { - versionName: platform.WindowsPowerShell32BitLabel, - exePath: platform.System32PowerShellPath, - }, - ]); - - checkFixedWindowsPowerShellpath( - platformDetails, - platform.SysWow64PowerShellPath, - platform.System32PowerShellPath); - }); - - suite("32-bit Windows, 32-bit VS Code", () => { - const platformDetails: platform.IPlatformDetails = { - operatingSystem: platform.OperatingSystem.Windows, - isOS64Bit: false, - isProcess64Bit: false, - }; - - checkDefaultPowerShellPath( - platformDetails, - platform.System32PowerShellPath); - - checkAvailableWindowsPowerShellPaths( - platformDetails, - [ - { - versionName: platform.WindowsPowerShell32BitLabel, - exePath: platform.System32PowerShellPath, - }, - ]); - }); -});