Skip to content

Commit 168efff

Browse files
committed
fix perf tests
1 parent 3caa580 commit 168efff

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

src/test/suite/documentParser.test.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import * as assert from 'assert';
2-
import * as utils from "../../utils";
32
import * as vscode from 'vscode';
4-
import * as testUtils from '../testUtils';
53
import { DocumentParser } from '../../documentParser';
64

75
suite('DocumentParser tests', async () => {
8-
let parser: DocumentParser;
6+
const parser: DocumentParser = new DocumentParser();
97
let docSample1: vscode.TextDocument;
108

119
suiteSetup(async () => {
12-
parser = new DocumentParser();
1310
docSample1 = await vscode.workspace.openTextDocument({
1411
language: 'powershell',
1512
content: `
@@ -24,9 +21,6 @@ $b
2421
$notfound
2522
`,
2623
});
27-
28-
// Ensure PowerShell extension is finished starting because we need it's symbol provider
29-
await testUtils.ensureEditorServicesIsConnected();
3024
});
3125

3226
suite('getFunctionsInScope() function', async () => {
@@ -176,7 +170,7 @@ test2
176170
language: 'powershell',
177171
content: `
178172
function test2 {
179-
$b # Stopped location
173+
$b
180174
}; $param = @{ # Stopped location
181175
Abc = 123 # Stopped location
182176
} # Stopped location

src/test/suite/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
import * as path from 'path';
22
import * as Mocha from 'mocha';
33
import * as glob from 'glob';
4+
import * as testUtils from '../testUtils';
45

5-
export function run(): Promise<void> {
6+
export async function run(): Promise<void> {
67
// Create the mocha test
78
const mocha = new Mocha({
89
ui: 'tdd',
9-
color: true,
10-
timeout: 10000 // Increased to let PowerShell extension + PSES load in CI
10+
color: true
1111
});
1212

1313
const testsRoot = path.resolve(__dirname, '..');
1414

15+
// Ensure PowerShell extension is finished starting because we need it's symbol provider
16+
await testUtils.ensureEditorServicesIsConnected();
17+
1518
return new Promise((c, e) => {
1619
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
1720
if (err) {

src/test/suite/powerShellVariableInlineValuesProvider.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
import * as assert from 'assert';
2-
32
import * as vscode from 'vscode';
43
import { PowerShellVariableInlineValuesProvider } from '../../powerShellVariableInlineValuesProvider';
5-
import * as testUtils from '../testUtils';
64
import { DocumentParser } from '../../documentParser';
75

86
suite('PowerShellVariableInlineValuesProvider tests', async () => {
9-
suiteSetup(async () => {
10-
await testUtils.ensureEditorServicesIsConnected();
11-
});
12-
137
suite('Variable detection', async () => {
148
const provider: PowerShellVariableInlineValuesProvider = new PowerShellVariableInlineValuesProvider(new DocumentParser());
159

0 commit comments

Comments
 (0)