Skip to content

Commit 9f33e23

Browse files
committed
Get testExtensionId from package.json
1 parent 624e065 commit 9f33e23

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

test/features/ExternalApi.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import * as vscode from "vscode";
66
import { before, beforeEach, afterEach } from "mocha";
77
import { IExternalPowerShellDetails, IPowerShellExtensionClient } from "../../src/features/ExternalApi";
88

9-
const testExtensionId = "ms-vscode.powershell-preview";
9+
// tslint:disable-next-line: no-var-requires
10+
const PackageJSON: any = require("../../../package.json");
11+
const testExtensionId = `${PackageJSON.publisher}.${PackageJSON.name}`;
1012

1113
suite("ExternalApi feature - Registration API", () => {
1214
let powerShellExtensionClient: IPowerShellExtensionClient;
@@ -82,7 +84,7 @@ suite("ExternalApi feature - Other APIs", () => {
8284
});
8385

8486
beforeEach(() => {
85-
sessionId = powerShellExtensionClient.registerExternalExtension("ms-vscode.powershell-preview");
87+
sessionId = powerShellExtensionClient.registerExternalExtension(testExtensionId);
8688
});
8789

8890
afterEach(() => {

test/runTests.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import * as path from "path";
66

77
import { runTests } from "vscode-test";
88

9+
// tslint:disable-next-line: no-var-requires
10+
const PackageJSON: any = require("../../package.json");
11+
const testExtensionId = `${PackageJSON.publisher}.${PackageJSON.name}`;
12+
913
async function main() {
1014
try {
1115
// The folder containing the Extension Manifest package.json
@@ -22,7 +26,7 @@ async function main() {
2226
extensionTestsPath,
2327
launchArgs: [
2428
"--disable-extensions",
25-
"--enable-proposed-api", "ms-vscode.powershell-preview",
29+
"--enable-proposed-api", testExtensionId,
2630
"./test"
2731
],
2832
version: "insiders"

0 commit comments

Comments
 (0)