Skip to content

Commit d93099f

Browse files
Add mocha-multi-reporters for better CI test output
- Install mocha-multi-reporters package - Configure test:ci to output both spec (console) and xunit (XML) formats - Pipeline will now show detailed test progress in logs while still generating test-results.xml for Azure DevOps - All 181 tests passing
1 parent 39b5262 commit d93099f

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

.mocha-multi-reporters.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"reporterEnabled": "spec, xunit",
3+
"xunitReporterOptions": {
4+
"output": "test-results.xml"
5+
}
6+
}

package-lock.json

Lines changed: 29 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"build:tests": "tsc -p tsconfig.tests.json",
2222
"postbuild:tests": "ncp tests/build-samples _tests/build-samples && ncp tests/extension-samples _tests/extension-samples",
2323
"test": "npm run build:tests && mocha \"_tests/tests/**/*.js\"",
24-
"test:ci": "npm run build:tests && mocha \"_tests/tests/**/*.js\" --reporter xunit --reporter-options output=test-results.xml",
24+
"test:ci": "npm run build:tests && mocha \"_tests/tests/**/*.js\" --reporter mocha-multi-reporters --reporter-options configFile=.mocha-multi-reporters.json",
2525
"test:commandline": "npm run build:tests && mocha \"_tests/tests/commandline.js\"",
2626
"test:server-integration": "npm run build:tests && mocha \"_tests/tests/server-integration-*.js\"",
2727
"test:focused-login": "npm run build:tests && mocha \"_tests/tests/focused-login-test.js\"",
@@ -74,6 +74,7 @@
7474
"@types/xml2js": "0.0.27",
7575
"adm-zip": "^0.5.16",
7676
"mocha": "^10.2.0",
77+
"mocha-multi-reporters": "^1.5.1",
7778
"ncp": "^2.0.0",
7879
"rimraf": "^2.6.1",
7980
"typescript": "^4.9.5"

0 commit comments

Comments
 (0)