@mochajs/multi-reporter
Multiple reporter for Mocha
Installation
$ npm i -D @mochajs/multi-reporter
Usage
Use --reporter
in your test command.
{
"scripts": {
"test": "mocha --reporter @mochajs/multi-reporter"
}
}
Or, add reporter
to your configuration file.
{
"reporter": "@mochajs/multi-reporter"
}
Create .reporters.json
file.
{
"spec": true,
"xunit": {
"output": "report.xml"
}
}
Options
config
By default, it will use .reporters.json
as config file. To use other file, use --reporter-options
in your test command.
{
"scripts": {
"test": "mocha --reporter @mochajs/multi-reporter --reporter-options config=filename.json"
}
}
Or, add reporter-option
to your configuration file.
{
"reporter": "@mochajs/multi-reporter",
"reporter-option": [
"config=filename.json"
]
}