michaelleeallen / mocha-junit-reporter

A JUnit XML reporter for mocha.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't read .mocharc.js file

asap opened this issue · comments

commented

Tried to set up an rc file like so:

module.exports = {
    reporter: 'mocha-junit-reporter',
    reporterOptions: {
        mochaFile: './path_to_your/file.xml'
    }
}

And didn't see the xml file in the path.

If I remove reporterOptions, I notice that test-result.xml gets spit out in the root of my project.

I decided to poke into the mocha-junit-reporter code and dropped a single console.log in configureDefaults and noticed that reporterOptions is always undefined.

I am able to get it to work if I set it up as a script in package.json and via command line, but I'd rather have it as a config file. I'm not sure if this is a problem with Mocha or this library, so I figured I would start here.

Using versions:

    "mocha": "^6.2.0",
    "mocha-junit-reporter": "^1.23.1",

Thanks in advance.

Same here. Same versions.