michaelleeallen / mocha-junit-reporter

A JUnit XML reporter for mocha.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not generating Junit XML test report for Failed tests for Mocha Version 8.3.2

SBekkari9495 opened this issue · comments

I'm using the mocha-junit-reporter to generate XML report to publish the test result in VSTS under tests tab .
I followed the steps provided in https://www.npmjs.com/package/mocha-junit-reporter.

In package.json i included the following script.
"scripts": {
"mochaTest": "mocha './tests/**/*Test.js' && mocha tests --reporter mocha-junit-reporter --reporter-option mochaFile=./mocha_Junit_Reporter/test-results.xml",
}
But it's generating for only passes test cases, if one case is failing then xml file is not generating /updating at all.

I'm also facing the same issue, it works with mocha version 7.2.0, but its failing if the mocha version is greater than that.

I can't reproduce with mocha@9.12 and mocha-junit-reporter@2.0.2.

Reproducible using mocha 10.2.0 and mocha-junit-reporter 2.2.0 and a simple intentional failing test case

describe("intentional failure", () => {
  expect(false).to.equal(true)
})