michaelleeallen / mocha-junit-reporter

A JUnit XML reporter for mocha.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mochaFile option doesn't work

dramamask opened this issue · comments

I upgraded from version 1.18.0 to 1.23.2, and the mochaFile option didn't work anymore. Instead writing to the designated folder and filename, a generic "test-results.xml" file was created in the root.

I use the mocha file option like this in my package.json file: "--reporter-options mochaFile=./path_to_your/file.xml"

I can confirm this issue as well. We are using the same setting in the package.json and experience the same behavior.

Versions:
mocha-junit-reporter: 1.23.2
mocha: 6.2.2

Edit Duplicate of #106

Should be resolved with 1.23.3

I am on 1.23.3, this issue is still a thing. Mocha 7.1.0.

reporterOptions: {
  mochaFile: '../reports/contract.xml'
},

A generic test-results.xml file is created every time.

We are setting these options via the .mocharc.js configuration file.

EDIT: Setting them via the CLI works, so it is an issue with pulling the configuration from the config files. I'll open a new issue.

I had the same issue in my cypress configuration (using cypress-multi-reporters with mocha-junit-reporter) when I upgraded to the latest mocha-junit-version v1.23.3.

With v1.23.0 it works fine and uses mochaFile field.