Skip to content

Commit cfd75d9

Browse files
committed
Support JUnit report from Mocha tests
1 parent bf6ef53 commit cfd75d9

File tree

3 files changed

+136
-5
lines changed

3 files changed

+136
-5
lines changed

integration/vscode/ada/package-lock.json

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

integration/vscode/ada/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@
575575
"eslint-plugin-tsdoc": "0.2.17",
576576
"glob": "9.3.0",
577577
"mocha": "10.2.0",
578+
"mocha-junit-reporter": "^2.2.0",
578579
"prettier": "2.8.4",
579580
"typescript": "4.9.5",
580581
"vscode-tmgrammar-test": "0.1.1"

integration/vscode/ada/test/suite/index.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
import { resolve } from 'path';
21
import { Glob, GlobOptionsWithFileTypesUnset } from 'glob';
3-
import Mocha from 'mocha';
2+
import Mocha, { MochaOptions } from 'mocha';
3+
import { resolve } from 'path';
44
import { env } from 'process';
55

66
export function run(): Promise<void> {
7-
// Create the mocha test
8-
const mocha = new Mocha({
7+
const mochaOptions: MochaOptions = {
98
ui: 'tdd',
109
color: true,
11-
});
10+
};
11+
12+
if (process.env.MOCHA_REPORTER) {
13+
mochaOptions.reporter = process.env.MOCHA_REPORTER;
14+
}
15+
16+
// Create the mocha test
17+
const mocha = new Mocha(mochaOptions);
1218

1319
const testsRoot = resolve(__dirname, '..');
1420

0 commit comments

Comments
 (0)