@ambassify/mocha-reporter
v1.0.0
Published
Mocha reporter for Ambassify projects. Preconfigured for our CI pipeline.
Downloads
37
Readme
@ambassify/mocha-reporter
An opinionated replacement for mocha-circleci-reporter which seems to be abandoned. This includes some defaults that should make it easier to run our tests on CirclCI and get usefull reporting on the tests.
Install
npm i -D @ambassify/mocha-reporter
Usage
mocha --reporter @ambassify/mocha-reporter
Reporters
This reporter runs the default Spec
reporter for nice console output and simultaneously the mocha-junit-reporter
to output XML results that CircleCI understands.
The Spec
reporter is always enabled. mocha-junit-reporter
will be enabled when the CI
environment variable is set (a common default on CI software like CircleCI) of the ci
reporter option is passed to mocha (mocha --reporter @ambassify/mocha-reporter --reporter-option ci
).
Test results
By default, the XML test results from JUnit reporter are saved to ./test-results/mocha.[hash].xml
. We recommend not changing this so all Ambassify projects use the same output. You need to set the store_test_results option to this ./test-results
path in your CircleCI config file to have it pick up the results. See this repository's config file for an example.