Skip to content

Commit 7bf4361

Browse files
committed
Set Mocha timeout to 30 seconds per test/hook
Since so many tests require this anyway due to startup times.
1 parent e26497e commit 7bf4361

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

test/features/ExternalApi.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,5 @@ suite("ExternalApi feature - Other APIs", () => {
9494
assert.notStrictEqual(versionDetails.version, null);
9595

9696
// Start up can take some time...so set the timeout to 30 seconds.
97-
}).timeout(30000);
97+
});
9898
});

test/features/ISECompatibility.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ suite("ISECompatibility feature", () => {
4343
const currently = vscode.workspace.getConfiguration(iseSetting.path).get(iseSetting.name);
4444
assert.notStrictEqual(currently, iseSetting.value);
4545
}
46-
}).timeout(10000);
46+
});
4747

4848
test("It doesn't change theme when disabled if theme was manually changed after being enabled", async () => {
4949
assert.strictEqual(vscode.workspace.getConfiguration("workbench").get("colorTheme"), "PowerShell ISE");
@@ -58,5 +58,5 @@ suite("ISECompatibility feature", () => {
5858
assert.notStrictEqual(currently, iseSetting.value);
5959
}
6060
assert.strictEqual(vscode.workspace.getConfiguration("workbench").get("colorTheme"), "Monokai");
61-
}).timeout(10000);
61+
});
6262
});

test/features/RunCode.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,12 @@ suite("RunCode tests", () => {
5050
// Open the PowerShell file with Pester tests and then wait a while for
5151
// the extension to finish connecting to the server.
5252
await vscode.commands.executeCommand("vscode.open", vscode.Uri.file(pesterTests));
53-
await sleep(15000);
53+
await sleep(10000);
5454

5555
// Now run the Pester tests, check the debugger started, wait a bit for
5656
// it to run, and then kill it for safety's sake.
5757
assert(await vscode.commands.executeCommand("PowerShell.RunPesterTestsFromFile"));
5858
assert(vscode.debug.activeDebugSession !== undefined);
59-
await sleep(5000);
6059
await vscode.debug.stopDebugging();
61-
}).timeout(30000);
60+
});
6261
});

test/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function run(): Promise<void> {
1414
ui: "tdd",
1515
color: !process.env.TF_BUILD, // colored output from test results
1616
reporter: "mocha-multi-reporters",
17-
timeout: 5000,
17+
timeout: 30000, // 30s because PowerShell startup is slow!
1818
reporterOptions: {
1919
// NOTE: The XML output by Mocha's xUnit reporter is actually in the
2020
// JUnit style. I'm unsure how no one else has noticed this.

0 commit comments

Comments
 (0)