michaelleeallen / mocha-junit-reporter

A JUnit XML reporter for mocha.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there a way to use this with mocha-headless-chrome (i.e., in a browser)?

radix opened this issue · comments

I am trying to set up my CI to use this reporter, and we run our tests in mocha-headless-chrome. Unfortunately it doesn't seem to work because the mocha-junit-reporter uses node-specific APIs such as "fs".

It seems unlikely that this would be a good fit for a browser environment. Can you describe how you think that would be accomplished? Would you expect the browser to end with the DOM containing the XML report, etc?

@clayreimann see the project page here https://github.com/direct-adv-interfaces/mocha-headless-chrome#readme

In my experience all other reporters work with this tool. I think all it needs to do is avoid using any node-specific APIs and just print stuff to the console. If the API could optionally be used without any of the file manipulation stuff I think it would work.

Printing to stdout should arguably be the default if you don't specify mochaFile. That's how all standard mocha reporters work AFAIK.

Of course, that would be a breaking change.