1.3.2 • Published 3 years ago

@oconnorjoseph/json-file-reporter v1.3.2

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

npm version JavaScript Style Guide

@mochajs/json-file-reporter

JSON file reporter for Mocha

Installation

$ npm i -D @mochajs/json-file-reporter

Usage

Use --reporter in your test command.

{
  "scripts": {
    "test": "mocha --reporter @mochajs/json-file-reporter"
  }
}

Or, add reporter to your configuration file.

{
  "reporter": "@mochajs/json-file-reporter"
}

Options

output

By default, it will output to report.json. To write to other file, use --reporter-options in your test command.

{
  "scripts": {
    "test": "mocha --reporter @mochajs/json-file-reporter --reporter-options output=filename.json"
  }
}

Or, add reporter-option to your configuration file.

{
  "reporter": "@mochajs/json-file-reporter",
  "reporter-option": [
    "output=filename.json"
  ]
}