We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When the error message or stack contains any non-safe characters, it breaks the xunit file and the resulting report is no longer valid XML.
Repro:
# Explicit: npm init --yes npm i -D mocha echo "it('throws', () => { throw new Error('\x1B[32mfoo\x1B[0m'); })">test.js ./node_modules/.bin/mocha -R xunit -O output=report.xml test.js # One-liner: npm init --yes >/dev/null && npm i -D mocha >/dev/null && echo "it('throws', () => { throw new Error('\x1B[32mfoo\x1B[0m'); })">test.js && ./node_modules/.bin/mocha -R xunit -O output=report.xml test.js
Running report.xml through an online validator will trigger messages like the following:
report.xml
An invalid XML character (Unicode: 0x1b) was found in the element content of the document.
The text was updated successfully, but these errors were encountered:
Add utils.escape tests and fix unicode escaping
utils.escape
61221e2
Fixes mochajs#2955
9f403bf
Fixes #2955
67be01f
No branches or pull requests
When the error message or stack contains any non-safe characters, it breaks the xunit file and the resulting report is no longer valid XML.
Repro:
Running
report.xml
through an online validator will trigger messages like the following:The text was updated successfully, but these errors were encountered: