diff --git a/test/features/ExternalApi.test.ts b/test/features/ExternalApi.test.ts index 0e7d895307..3cd3cdd82e 100644 --- a/test/features/ExternalApi.test.ts +++ b/test/features/ExternalApi.test.ts @@ -6,7 +6,9 @@ import * as vscode from "vscode"; import { before, beforeEach, afterEach } from "mocha"; import { IExternalPowerShellDetails, IPowerShellExtensionClient } from "../../src/features/ExternalApi"; -const testExtensionId = "ms-vscode.powershell-preview"; +// tslint:disable-next-line: no-var-requires +const PackageJSON: any = require("../../../package.json"); +const testExtensionId = `${PackageJSON.publisher}.${PackageJSON.name}`; suite("ExternalApi feature - Registration API", () => { let powerShellExtensionClient: IPowerShellExtensionClient; @@ -42,8 +44,7 @@ suite("ExternalApi feature - Registration API", () => { */ test("API fails if not registered", async () => { assert.rejects( - async () => await powerShellExtensionClient.getPowerShellVersionDetails(""), - "UUID provided was invalid, make sure you ran the 'powershellExtensionClient.registerExternalExtension(extensionId)' method and pass in the UUID that it returns to subsequent methods."); + async () => await powerShellExtensionClient.getPowerShellVersionDetails("")) }); test("It can't register the same extension twice", async () => { @@ -82,7 +83,7 @@ suite("ExternalApi feature - Other APIs", () => { }); beforeEach(() => { - sessionId = powerShellExtensionClient.registerExternalExtension("ms-vscode.powershell-preview"); + sessionId = powerShellExtensionClient.registerExternalExtension(testExtensionId); }); afterEach(() => { diff --git a/test/runTests.ts b/test/runTests.ts index 283ba84f46..cb98abee31 100644 --- a/test/runTests.ts +++ b/test/runTests.ts @@ -6,6 +6,10 @@ import * as path from "path"; import { runTests } from "vscode-test"; +// tslint:disable-next-line: no-var-requires +const PackageJSON: any = require("../../package.json"); +const testExtensionId = `${PackageJSON.publisher}.${PackageJSON.name}`; + async function main() { try { // The folder containing the Extension Manifest package.json @@ -22,7 +26,7 @@ async function main() { extensionTestsPath, launchArgs: [ "--disable-extensions", - "--enable-proposed-api", "ms-vscode.powershell-preview", + "--enable-proposed-api", testExtensionId, "./test" ], version: "insiders"