Skip to content

Commit 897d4c5

Browse files
committed
Run EnableISEMode and DisableISEMode in setup and teardown
So that they're always run as expected, leaving the state clean for the next test regardless of ordering.
1 parent 6af1fe5 commit 897d4c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/features/ISECompatibility.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33

44
import * as assert from "assert";
55
import * as vscode from "vscode";
6-
import { suiteSetup } from "mocha";
6+
import { suiteSetup, setup, teardown } from "mocha";
77
import { ISECompatibilityFeature } from "../../src/features/ISECompatibility";
88
import utils = require("../utils");
99

1010
suite("ISECompatibility feature", () => {
1111
suiteSetup(utils.ensureExtensionIsActivated);
12+
setup(async () => { await vscode.commands.executeCommand("PowerShell.EnableISEMode"); });
13+
teardown(async () => { await vscode.commands.executeCommand("PowerShell.DisableISEMode"); });
1214

1315
test("It sets ISE Settings", async () => {
14-
await vscode.commands.executeCommand("PowerShell.EnableISEMode");
1516
for (const iseSetting of ISECompatibilityFeature.settings) {
1617
const currently = vscode.workspace.getConfiguration(iseSetting.path).get(iseSetting.name);
1718
assert.strictEqual(currently, iseSetting.value);
@@ -31,7 +32,6 @@ suite("ISECompatibility feature", () => {
3132
}).timeout(10000);
3233

3334
test("It leaves Theme after being changed after enabling ISE Mode", async () => {
34-
await vscode.commands.executeCommand("PowerShell.EnableISEMode");
3535
assert.strictEqual(vscode.workspace.getConfiguration("workbench").get("colorTheme"), "PowerShell ISE");
3636

3737
await vscode.workspace.getConfiguration("workbench").update("colorTheme", "Dark+", true);

0 commit comments

Comments
 (0)