Skip to content

Commit 6e170f2

Browse files
committed
Update dependencies
1 parent 8edbde9 commit 6e170f2

File tree

3 files changed

+155
-208
lines changed

3 files changed

+155
-208
lines changed

package.json

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,12 @@
1515
},
1616
"packageManager": "[email protected]",
1717
"engines": {
18-
"vscode": "^1.68.0"
18+
"vscode": "^1.75.0"
1919
},
2020
"activationEvents": [
2121
"onLanguage:haml",
2222
"onLanguage:ruby",
23-
"workspaceContains:Gemfile.lock",
24-
"onCommand:syntaxTree.start",
25-
"onCommand:syntaxTree.stop",
26-
"onCommand:syntaxTree.restart",
27-
"onCommand:syntaxTree.showOutputChannel",
28-
"onCommand:syntaxTree.visualize"
23+
"workspaceContains:Gemfile.lock"
2924
],
3025
"main": "./out/extension",
3126
"contributes": {
@@ -116,12 +111,11 @@
116111
"vscode-languageclient": "9.0.1"
117112
},
118113
"devDependencies": {
119-
"@types/glob": "^8.0.0",
120114
"@types/mocha": "^10.0.0",
121115
"@types/node": "^24.0.0",
122-
"@types/vscode": "^1.68.0",
123-
"@typescript-eslint/eslint-plugin": "^5.47.0",
124-
"@typescript-eslint/parser": "^5.47.0",
116+
"@types/vscode": "^1.75.0",
117+
"@typescript-eslint/eslint-plugin": "^8.37.0",
118+
"@typescript-eslint/parser": "^8.37.0",
125119
"@vscode/test-electron": "^2.2.0",
126120
"esbuild": "^0.25.0",
127121
"eslint": "^9.12.0",

src/test/suite/index.ts

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import * as path from "path";
22
import * as Mocha from "mocha";
3-
import * as glob from "glob";
3+
import { glob } from "glob";
44

55
import { TIMEOUT_MS } from "./setup";
66

7-
export function run(): Promise<void> {
7+
export async function run(): Promise<void> {
88
const mocha = new Mocha({
99
asyncOnly: true,
1010
color: true,
@@ -16,33 +16,32 @@ export function run(): Promise<void> {
1616

1717
const testsRoot = path.resolve(__dirname, "..");
1818

19-
return new Promise((c, e) => {
20-
glob("**/**.test.js", { cwd: testsRoot }, (err, files) => {
21-
if (err) {
22-
return e(err);
23-
}
19+
try {
20+
// Find all test files
21+
const files = await glob("**/**.test.js", { cwd: testsRoot });
2422

25-
// Add files to the test suite
26-
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
23+
// Add files to the test suite
24+
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
2725

28-
try {
29-
// Run the mocha test
30-
mocha.run(failures => {
31-
if (failures > 0) {
32-
// Let the cameras roll for a bit & make sure we capture the error
33-
if (process.env.CI) {
34-
setTimeout(() => e(new Error(`${failures} tests failed; pausing for dramatic effect.`)), 3000);
35-
} else {
36-
e(new Error(`${failures} tests failed.`));
37-
}
26+
// Run the mocha test and wrap in a promise since mocha.run uses callbacks
27+
await new Promise<void>((resolve, reject) => {
28+
mocha.run(failures => {
29+
if (failures > 0) {
30+
const error = new Error(`${failures} tests failed${process.env.CI ? '; pausing for dramatic effect.' : '.'}`);
31+
32+
// Let the cameras roll for a bit & make sure we capture the error
33+
if (process.env.CI) {
34+
setTimeout(() => reject(error), 3000);
3835
} else {
39-
c();
36+
reject(error);
4037
}
41-
});
42-
} catch (err) {
43-
console.error(err);
44-
e(err);
45-
}
38+
} else {
39+
resolve();
40+
}
41+
});
4642
});
47-
});
43+
} catch (err) {
44+
console.error(err);
45+
throw err;
46+
}
4847
}

0 commit comments

Comments
 (0)