Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 91 additions & 79 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -553,9 +553,9 @@
],
"devDependencies": {
"@types/fs-extra": "^9.0.13",
"@types/glob": "^7.2.0",
"@types/lodash": "^4.17.25",
"@types/lru-cache": "^7.10.10",
"@types/minimatch": "^5.1.2",
"@types/mocha": "^9.1.1",
"@types/node": "^16.18.13",
"@types/sinon": "^22.0.0",
Expand All @@ -564,7 +564,7 @@
"@typescript-eslint/parser": "^5.60.1",
"@vscode/test-electron": "^3.1.0",
"eslint": "^8.43.0",
"glob": "^7.2.3",
"glob": "^13.0.6",
"mocha": "^11.1.0",
Comment thread
chagong marked this conversation as resolved.
"sinon": "^22.1.0",
"ts-loader": "^9.4.2",
Expand All @@ -577,6 +577,7 @@
"iconv-lite": "^0.7.3",
"lodash": "^4.18.1",
"lru-cache": "^7.17.0",
"minimatch": "^3.1.5",
"vscode-extension-telemetry-wrapper": "^0.15.3",
"vscode-languageclient": "6.0.0-next.9",
"vscode-tas-client": "^0.1.75"
Expand Down
40 changes: 18 additions & 22 deletions test/suite/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

import * as glob from 'glob';
import { glob } from 'glob';
import * as Mocha from 'mocha';
import * as path from 'path';

export function run(): Promise<void> {
export async function run(): Promise<void> {
// Create the mocha test
const mocha = new Mocha({
ui: 'tdd',
Expand All @@ -15,27 +15,23 @@ export function run(): Promise<void> {

const testsRoot = __dirname;

return new Promise((c, e) => {
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
if (err) {
return e(err);
}
const files = (await glob('**/**.test.js', { cwd: testsRoot })).sort((a, b) => a.localeCompare(b, 'en'));

// Add files to the test suite
files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)));
// Add files to the test suite
files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)));

try {
// Run the mocha test
mocha.run((failures) => {
if (failures > 0) {
e(new Error(`${failures} tests failed.`));
} else {
c();
}
});
} catch (err) {
e(err);
}
});
return new Promise((c, e) => {
try {
// Run the mocha test
mocha.run((failures) => {
if (failures > 0) {
e(new Error(`${failures} tests failed.`));
} else {
c();
}
});
} catch (err) {
e(err);
}
});
}
Loading