You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to run the xunit reporter while in CI, and the spec reporter in dev. I'm using mocha-env-reporter to accomplish this. In CI I set the mocha_reporter environment variable in production and it switches the reporter.
However I also need to set the filename for each test suite. With mocha-junit-reporter I can do this with the MOCHA_FILE environment variable, however with the built-in xunit reporter I have to do it on the command line. This is inconvenient because it requires duplicating a bunch of parameters on the mocha command line into the CI config.
I've used Mocha for a long time and really like it. After some recent experiences with other test tools, I appreciate it even more. 😄
That said, config and reporters can be frustrating and fiddly to manage, especially across many small projects.
I was glad to hear about upcoming improvements to the config in #3612 and hoping there are more to come. I know often there's a goal to push use cases out to plugins, and appreciate that. I'm glad that Mocha does not take as much install footprint as, say, Jest.
However there are some things, like a reliable way to write reports to a file, which are not specialized, and really belong in core. If there's interest, I'd be happy to put some work into documenting and improving ease of use in this area.
Prerequisites
faq
labelDescription
I want to run the xunit reporter while in CI, and the spec reporter in dev. I'm using
mocha-env-reporter
to accomplish this. In CI I set themocha_reporter
environment variable in production and it switches the reporter.However I also need to set the filename for each test suite. With
mocha-junit-reporter
I can do this with theMOCHA_FILE
environment variable, however with the built-in xunit reporter I have to do it on the command line. This is inconvenient because it requires duplicating a bunch of parameters on the mocha command line into the CI config.It would be helpful to be able to configure the output file for the xunit reporter through the environment, in the same way I can with
mocha-junit-reporter
.The text was updated successfully, but these errors were encountered: