Gathering detailed insights and metrics for mocha-multi
Gathering detailed insights and metrics for mocha-multi
Gathering detailed insights and metrics for mocha-multi
Gathering detailed insights and metrics for mocha-multi
mocha-multi-reporters
Generate multiple mocha reports in a single mocha execution.
cypress-multi-reporters
Generate multiple mocha reports in a single mocha execution.
@jlowcs/mocha-multi
A bit of a hack to get multiple reporters working with mocha
multi-mocha
Parallel mocha test runner
npm install mocha-multi
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (71.62%)
Shell (28.38%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
77 Stars
200 Commits
23 Forks
6 Watchers
13 Branches
15 Contributors
Updated on Dec 07, 2024
Minified
Minified + Gzipped
Latest Version
1.1.7
Package Id
mocha-multi@1.1.7
Unpacked Size
20.91 kB
Size
7.79 kB
File Count
9
NPM Version
8.18.0
Node Version
18.8.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
5
1
A bit of a hack to get multiple reporters working with mocha
npm install mocha-multi --save-dev
mocha --reporter mocha-multi
For both methods below, the special value of -
(hyphen) for destination uses normal stdout/stderr.
multi
Environment VariableSet the environment variable multi
to whitespace-separated type=destination pairs.
1multi='dot=- xunit=file.xml doc=docs.html' mocha -R mocha-multi
--reporter-options
Pass --reporter-options
with comma-separated type=destination pairs.
1mocha -R mocha-multi --reporter-options dot=-,xunit=file.xml,doc=docs.html
Using either of the above methods, include a type=destination pair where the type is mocha-multi and the destination is a filename, e.g. mocha-multi=mocha-multi-reporters.json
More reporters will be loaded from the named file, which must be valid JSON in the same data format described below for passing reporterOptions to Mocha programmatically.
You may specify the desired reporters (and their options) by passing reporterOptions
to the Mocha contructor.
For example: the following config is the equivalent of setting multi='spec=- Progress=/tmp/mocha-multi.Progress.out'
, with the addition of passing the verbose: true
option to the Progress reporter.
1var reporterOptions = { 2 Progress: { 3 stdout: "/tmp/mocha-multi.Progress.out", 4 options: { 5 verbose: true 6 } 7 }, 8 spec: "-" 9}; 10 11var mocha = new Mocha({ 12 ui: "bdd" 13 reporter: "mocha-multi", 14 reporterOptions: reporterOptions 15}); 16mocha.addFile("test/dummy-spec.js"); 17mocha.run(function onRun(failures){ 18 console.log(failures); 19});
The options will be passed as the second argument to the reporter constructor.
A big hack that keeps changing the value of process.stdout and process.stderr whenever a reporter is doing its thing.
Yeah, Sorry!
This is very hacky, specifically:
process
and console
objects get their internal state messed withprocess.exit
is hacked to wait for streams to finish writingNow that https://github.com/mochajs/mocha/pull/1059 is released the process.exit hack could maybe be tidier
Having each reporter run in a child process would make it eaiser to capture their streams, but might lead to other issues
The breaking changes are mostly around internals, and shouldn't affect most people.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 5/18 approved changesets -- score normalized to 2
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
21 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More