Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix hardcoded extension name string #3222

Merged
merged 2 commits into from
Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions test/features/ExternalApi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
andyleejordan marked this conversation as resolved.
Show resolved Hide resolved
const testExtensionId = `${PackageJSON.publisher}.${PackageJSON.name}`;

suite("ExternalApi feature - Registration API", () => {
let powerShellExtensionClient: IPowerShellExtensionClient;
Expand Down Expand Up @@ -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 () => {
Expand Down Expand Up @@ -82,7 +83,7 @@ suite("ExternalApi feature - Other APIs", () => {
});

beforeEach(() => {
sessionId = powerShellExtensionClient.registerExternalExtension("ms-vscode.powershell-preview");
sessionId = powerShellExtensionClient.registerExternalExtension(testExtensionId);
});

afterEach(() => {
Expand Down
6 changes: 5 additions & 1 deletion test/runTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down