Skip to content

Commit c30033b

Browse files
Bump glob from 8.1.0 to 13.0.0 (#190)
Bumps [glob](https://github.com/isaacs/node-glob) from 8.1.0 to 13.0.0. <details> Required fixing glob 13.0.0 compatibility issues: - Update glob API usage from callback-based to async/Promise-based - Remove @types/glob (glob v13 includes TypeScript definitions) - Remove @types/minimatch (minimatch v10 includes TypeScript definitions) - Update minimatch override to ^10.0.0 (required by glob v13) - Update src/test/suite/index.ts to use new glob async API
1 parent 343a2af commit c30033b

File tree

3 files changed

+90
-82
lines changed

3 files changed

+90
-82
lines changed

package-lock.json

Lines changed: 68 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@
9090
},
9191
"devDependencies": {
9292
"@types/emscripten": "^1.41.5",
93-
"@types/glob": "^8.1.0",
94-
"@types/minimatch": "^5.1.2",
9593
"@types/mocha": "^10.0.10",
9694
"@types/node": "22.x",
9795
"@types/vscode": "^1.97.0",
@@ -109,13 +107,13 @@
109107
"eslint-plugin-prettier": "^5.5.4",
110108
"eslint-plugin-promise": "^6.1.1",
111109
"eslint-plugin-tsdoc": "^0.4.0",
112-
"glob": "^8.0.3",
110+
"glob": "^13.0.0",
113111
"mocha": "^11.7.5",
114112
"prettier": "3.7.4",
115113
"typescript": "^5.7.3"
116114
},
117115
"overrides": {
118-
"minimatch": "^5.1.6"
116+
"minimatch": "^10.0.0"
119117
},
120118
"dependencies": {
121119
"esbuild": "0.27.2",

src/test/suite/index.ts

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
33
import * as path from 'path';
44

5-
import glob = require('glob');
5+
import { glob } from 'glob';
66
import Mocha from 'mocha';
77

8-
export function run(): Promise<void> {
8+
export async function run(): Promise<void> {
99
// Create the mocha test
1010
const mocha = new Mocha({
1111
ui: 'tdd',
@@ -14,28 +14,25 @@ export function run(): Promise<void> {
1414

1515
const testsRoot = path.resolve(__dirname, '..');
1616

17-
return new Promise((resolve, reject) => {
18-
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
19-
if (err) {
20-
return reject(err);
21-
}
17+
// Find all test files using glob (now async in v13+)
18+
const files = await glob('**/**.test.js', { cwd: testsRoot });
2219

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

26-
try {
27-
// Run the mocha test
28-
mocha.run((failures) => {
29-
if (failures > 0) {
30-
reject(new Error(`${failures} tests failed.`));
31-
} else {
32-
resolve();
33-
}
34-
});
35-
} catch (err) {
36-
console.error(err);
37-
reject(err);
38-
}
39-
});
23+
return new Promise((resolve, reject) => {
24+
try {
25+
// Run the mocha test
26+
mocha.run((failures) => {
27+
if (failures > 0) {
28+
reject(new Error(`${failures} tests failed.`));
29+
} else {
30+
resolve();
31+
}
32+
});
33+
} catch (err) {
34+
console.error(err);
35+
reject(err);
36+
}
4037
});
4138
}

0 commit comments

Comments
 (0)