Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 945745b

Browse files
Handle OneBranch edge case PowerShell install
1 parent 0ad7bc8 commit 945745b

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

‎.vscode-test.mjs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { defineConfig } from "@vscode/test-cli";
2+
import { existsSync } from "fs";
23

34
export default defineConfig({
45
files: "test/**/*.test.ts",
@@ -10,7 +11,7 @@ export default defineConfig({
1011
// Undocumented but valid option to use a temporary profile for testing
1112
"--profile-temp",
1213
],
13-
workspaceFolder: "test/TestEnvironment.code-workspace",
14+
workspaceFolder: `test/${existsSync("C:\\powershell-7\\pwsh.exe") ? "OneBranch" : "TestEnvironment"}.code-workspace`,
1415
mocha: {
1516
ui: "bdd", // describe, it, etc.
1617
require: ["esbuild-register"], // transpile TypeScript on-the-fly

‎test/OneBranch.code-workspace‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
// A simple test environment that suppresses some first start warnings we don't care about.
3+
"folders": [
4+
{
5+
"path": "mocks",
6+
},
7+
],
8+
"settings": {
9+
"git.openRepositoryInParentFolders": "never",
10+
"csharp.suppressDotnetRestoreNotification": true,
11+
"extensions.ignoreRecommendations": true,
12+
// The settings tests account for this fix
13+
"powershell.powerShellAdditionalExePaths": {
14+
"OneBranch": "C:\\powershell-7\\pwsh.exe",
15+
},
16+
"powershell.powerShellDefaultVersion": "OneBranch",
17+
},
18+
}

‎test/core/settings.test.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT License.
33

44
import * as assert from "assert";
5+
import { existsSync } from "fs";
56
import * as os from "os";
67
import path from "path";
78
import * as vscode from "vscode";
@@ -38,6 +39,12 @@ describe("Settings E2E", function () {
3839

3940
it("Loads the correct defaults", function () {
4041
const testSettings = new Settings();
42+
if (existsSync("C:\\powershell-7\\pwsh.exe")) {
43+
testSettings.powerShellAdditionalExePaths = {
44+
OneBranch: "C:\\powershell-7\\pwsh.exe",
45+
};
46+
testSettings.powerShellDefaultVersion = "OneBranch";
47+
}
4148
const actualSettings = getSettings();
4249
assert.deepStrictEqual(actualSettings, testSettings);
4350
});

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /