You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
'Smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, your usage of Mocha, or Mocha itself
Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with: node node_modules/.bin/mocha --version(Local) and mocha --version(Global). We recommend avoiding the use of globally installed Mocha.
Description
The mocha xunit reporter escapes the grave character (`) incorrectly in the xunit reporter when placed in the spec name. It escapes it with ` which is valid in html but not in xml causing junit parsers (specifically jenkins in my test case but I have tested it with the w3schools validator as well with the same result) to not be able to parse test results.
Prerequisites
common mistake
labelnode node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend avoiding the use of globally installed Mocha.Description
The mocha xunit reporter escapes the grave character (`) incorrectly in the xunit reporter when placed in the spec name. It escapes it with ` which is valid in html but not in xml causing junit parsers (specifically jenkins in my test case but I have tested it with the w3schools validator as well with the same result) to not be able to parse test results.
Steps to Reproduce
Run the following code in the terminal.
Then take the resulting file and run it through an xml validator or a junit test result parser.
Expected behavior: [What you expect to happen]
produces a valid xml file
Actual behavior: [What actually happens]
Produces an invalid xml file with ` instead of the "`" character
Reproduces how often: [What percentage of the time does it reproduce?]
I am able to reproduce this 100% of the time.
Versions
Happens on mocha>=3.5.1
tested on osx 10.12 and ubuntu 14.04 with node 6.11.1, 6.11.2, 6.11.3
Additional Information
The text was updated successfully, but these errors were encountered: