Skip to content

Commit 5bb1a69

Browse files
committed
Update glob to 13.0.0
1 parent eec78c0 commit 5bb1a69

File tree

3 files changed

+43
-44
lines changed

3 files changed

+43
-44
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@
14811481
"eslint-config-mongodb-js": "^5.0.3",
14821482
"eslint-plugin-mocha": "^10.5.0",
14831483
"fork-ts-checker-webpack-plugin": "^9.0.2",
1484-
"glob": "^7.2.3",
1484+
"glob": "^13.0.0",
14851485
"husky": "^9.1.6",
14861486
"jsdom": "^23.2.0",
14871487
"mkdirp": "^1.0.4",

pnpm-lock.yaml

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

src/test/suite/index.ts

Lines changed: 32 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sourceMapSupport from 'source-map-support';
22
sourceMapSupport.install();
33
import Mocha from 'mocha';
4-
import glob from 'glob';
4+
import { glob } from 'glob';
55
import path from 'path';
66
import MDBExtensionController from '../../mdbExtensionController';
77
import { ExtensionContextStub } from './stubs';
@@ -37,45 +37,38 @@ export async function run(): Promise<void> {
3737

3838
await mdbTestExtension.testExtensionController.activate();
3939

40-
return new Promise((c, e) => {
41-
void glob(
42-
'**/**.test.js',
43-
{
44-
cwd: testsRoot,
45-
ignore: ['**/webview-app/**/*.js'],
46-
},
47-
(err, files) => {
48-
if (err) {
49-
return e(err);
50-
}
40+
const files = await glob('**/**.test.js', {
41+
cwd: testsRoot,
42+
ignore: ['**/webview-app/**/*.js'],
43+
});
5144

52-
// Add files to the test suite.
53-
files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)));
54-
try {
55-
// Run the mocha test.
56-
mocha.run((failures) => {
57-
// Deactivate the extension to properly clean up the language server
58-
void mdbTestExtension.testExtensionController
59-
.deactivate()
60-
.then(() => {
61-
if (failures > 0) {
62-
e(new Error(`${failures} tests failed.`));
63-
} else {
64-
c();
65-
}
66-
})
67-
.catch((deactivateErr) => {
68-
console.error('Error deactivating extension:');
69-
console.error(deactivateErr);
70-
e(deactivateErr);
71-
});
45+
// Add files to the test suite.
46+
files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)));
47+
48+
return new Promise((c, e) => {
49+
try {
50+
// Run the mocha test.
51+
mocha.run((failures) => {
52+
// Deactivate the extension to properly clean up the language server
53+
void mdbTestExtension.testExtensionController
54+
.deactivate()
55+
.then(() => {
56+
if (failures > 0) {
57+
e(new Error(`${failures} tests failed.`));
58+
} else {
59+
c();
60+
}
61+
})
62+
.catch((deactivateErr) => {
63+
console.error('Error deactivating extension:');
64+
console.error(deactivateErr);
65+
e(deactivateErr);
7266
});
73-
} catch (mochaRunErr) {
74-
console.error('Error running mocha tests:');
75-
console.error(mochaRunErr);
76-
e(mochaRunErr);
77-
}
78-
},
79-
);
67+
});
68+
} catch (mochaRunErr) {
69+
console.error('Error running mocha tests:');
70+
console.error(mochaRunErr);
71+
e(mochaRunErr);
72+
}
8073
});
8174
}

0 commit comments

Comments
 (0)