mocha-reporter-json-standard-grouped

Format Mocha test runner output to standardized JSON, grouped by successful suites and individual failed tests

Usage no npm install needed!

<script type="module">
  import mochaReporterJsonStandardGrouped from 'https://cdn.skypack.dev/mocha-reporter-json-standard-grouped';
</script>

README

mocha-reporter-json-standard-grouped

Format Mocha test runner output to standardized JSON, grouped by successful suites and individual failed tests

Description

Report Mocha test runner output to a standardized CI tooling output in JSON format.

In the process, it groups together all successful results belonging to the same suite and all individual failures.

It supports passing in comma-separated options to the reporter with mocha's --reporter-options flag. The available options are:

Option Name Type Default Description
quiet boolean false Silence console log output
saveJSONVar boolean false Saves output to the stats property of Mocha.reporters.Base
reportFileName string? undefined If defined, save output to reportFileName

This package is part of the series of packages for reporting tooling output in a standardized JSON format for use with the ci-checks-action Github action.

Other related packages include:

Install

npm install --save mocha-reporter-json-standard-grouped

Usage

mocha dist/index.test.js --reporter mocha-reporter-json-standard-grouped --reporter-options quiet=true,reportFileName=test-report.json

This will run mocha tests from the entry point dist/index.test.js and does not show the reporter results in console, instead sending it to the file test-report.json