stjohnjohnson / jenkins-mocha

Bin wrapper for Mocha + Istanbul + Xunit (for Jenkins)
https://www.npmjs.com/package/jenkins-mocha
MIT License
20 stars 16 forks source link

jenkins-mocha fails with multiple reporters? #37

Open IdanAdar opened 5 years ago

IdanAdar commented 5 years ago

@stjohnjohnson

It seems there is some incompatibility with Mocha 6.

This works:

mocha --recursive --reporter mocha-multi-reporters --reporter-options configFile=config/mocha-config.json --exit

This fails:

jenkins-mocha --recursive --reporter mocha-multi-reporters --reporter-options configFile=config/mocha-config.json --exit

The mocha-config.json:

{
   "reporterEnabled": "list,mocha-junit-reporter",
    "mochaJunitReporterReporterOptions": {
    "mochaFile": "testResults/results.xml"
    }
}
IdanAdar commented 5 years ago

@stjohnjohnson Can something be done?

stjohnjohnson commented 5 years ago

Interesting, so the way I would solve it is similar to how we check for cobutura. Detect that someone passes a reporter and then don't pass the reporter we automatically pass.