Skip to content

Commit

Permalink
upstream vscode-tester
Browse files Browse the repository at this point in the history
  • Loading branch information
msivasubramaniaan committed May 29, 2024
1 parent 6dbe697 commit e952ed1
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 74 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"glob": "^7.1.6",
"glob": "^10.3.16",
"mocha": "^9.1.2",
"path-browserify": "^1.0.1",
"prettier": "^3.2.5",
Expand All @@ -287,7 +287,7 @@
"umd-compat-loader": "^2.1.2",
"url": "^0.11.0",
"util": "^0.12.5",
"vscode-extension-tester": "^5.3.0",
"vscode-extension-tester": "^8.1",
"vscode-test": "^1.4.0",
"webpack": "^5.76.1",
"webpack-cli": "^5.0.1"
Expand Down
14 changes: 6 additions & 8 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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

export function run(): Promise<void> {
// Create the mocha test
Expand All @@ -17,14 +17,10 @@ export function run(): Promise<void> {
const testsRoot = path.resolve(__dirname, '..');

return new Promise((c, e) => {
glob('**/**.test.js', { cwd: testsRoot }, (err, files) => {
if (err) {
return e(err);
}

try {
const files = sync('**/**.test.js', { cwd: testsRoot });
// Add files to the test suite
files.forEach((f) => mocha.addFile(path.resolve(testsRoot, f)));

try {
// Run the mocha test
mocha.run((failures) => {
Expand All @@ -38,6 +34,8 @@ export function run(): Promise<void> {
console.error(err);
e(err);
}
});
} catch (error) {
e(error);
}
});
}
Loading

0 comments on commit e952ed1

Please sign in to comment.