1.0.2 • Published 3 years ago

mocha-reporter-json-standard-grouped v1.0.2

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

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 NameTypeDefaultDescription
quietbooleanfalseSilence console log output
saveJSONVarbooleanfalseSaves output to the stats property of Mocha.reporters.Base
reportFileNamestring?undefinedIf 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