1.0.0 • Published 3 years ago

@ambassify/mocha-reporter v1.0.0

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
3 years ago

@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.