Gathering detailed insights and metrics for @mcronin29/mochawesome-merge
Gathering detailed insights and metrics for @mcronin29/mochawesome-merge
Gathering detailed insights and metrics for @mcronin29/mochawesome-merge
Gathering detailed insights and metrics for @mcronin29/mochawesome-merge
Merge several Mochawesome JSON reports
npm install @mcronin29/mochawesome-merge
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
84 Stars
90 Commits
18 Forks
3 Watchers
12 Branches
10 Contributors
Updated on Jan 29, 2025
Latest Version
0.0.6-development
Package Id
@mcronin29/mochawesome-merge@0.0.6-development
Unpacked Size
22.56 kB
Size
7.12 kB
File Count
18
NPM Version
6.9.0
Node Version
10.16.3
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
Merge several Mochawesome JSON reports
via yarn
:
$ yarn add mochawesome-merge --dev
via npm
:
$ npm install mochawesome-merge --save-dev
1const { merge } = require('mochawesome-merge') 2 3// See Params section below 4const options = { 5 files: [ 6 './report/*.json', 7 8 // you can specify more files or globs if necessary: 9 './mochawesome-report/*.json', 10 ], 11} 12 13merge(options).then(report => { 14 console.log(report) 15})
$ npx mochawesome-merge ./report/*.json -o output.json
or legacy usage
$ npx mochawesome-merge ./report/*.json > output.json
You can specify as many paths as you wish:
$ npx mochawesome-merge ./report/*.json ./mochawesome-report/*.json -o output.json
You can also use a named option for the files like so:
$ npx mochawesome-merge -f ./report/*.json ./mochawesome-report/*.json -o output.json
files
: list of source report file paths. Can include glob patterns.-f | --files
or first positional argument["./mochawesome-report/mochawesome*.json"]
.output
: a file path to the bundled results. Should be a json
file-o | --output
stdout
.Version 4 has come with a breaking change —
it no more accepts params like reportDir
or rootDir
.
Instead, it now accepts a list of file paths or glob patterns
to source report files. If you are migrating to version 4
you likely have to change your params accordignly.
Let's say you have a bunch of reports that you want to merge
under ./mochawesome-report
directory.
Then you're probably using mochawesome-merge like this:
1merge({ 2 reportDir: "mochawesome-report", 3});
After switching to version 4 you need to rename
reportDir
param to files
and change the value to point to your files
rather than the directory:
1merge({ 2- reportDir: "mochawesome-report", 3+ files: ["./mochawesome-report/*.json"], 4})
After upgrading to version 4 all you need
is to remove the --reportDir
option
and instead specify a glob pattern
or several ones if necessary, separating each one with a space:
1- npx mochawesome-merge --reportDir mochawesome-report > mochawesome.json 2+ npx mochawesome-merge ./mochawesome-report/*.json > mochawesome.json
The main motivation to create this library was to be able to use mochawesome together with Cypress.
Since the version 3.0.0
, Cypress runs every spec separately, which leads to generating multiple mochawesome reports, one for each spec. mochawesome-merge
can be used to merge these reports and then generate one HTML report for all your cypress tests.
First, configure cypress.json
:
1{ 2 // use mochawesome reporter as usually 3 "reporter": "mochawesome", 4 "reporterOptions": { 5 // disable overwrite to generate many JSON reports 6 "overwrite": false, 7 // do not generate intermediate HTML reports 8 "html": false, 9 // generate intermediate JSON reports 10 "json": true 11 } 12}
Then, write your custom script to run cypress
together with mochawesome-merge
:
1const cypress = require('cypress') 2const marge = require('mochawesome-report-generator') 3const { merge } = require('mochawesome-merge') 4 5cypress.run().then( 6 () => { 7 generateReport() 8 }, 9 error => { 10 generateReport() 11 console.error(error) 12 process.exit(1) 13 } 14) 15 16function generateReport(options) { 17 return merge(options).then(report => marge.create(report, options)) 18}
Alternatively, you can use CLI to merge JSON reports and generate HTML report.
For example, an AWS CodeBuild buildspec.yml
file might look something like this:
1phases: 2 install: 3 commands: 4 - yarn install 5 build: 6 commands: 7 - yarn cypress run 8 post_build: 9 commands: 10 - yarn mochawesome-merge > mochawesome.json 11 - yarn marge mochawesome.json
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
Found 4/9 approved changesets -- score normalized to 4
Reason
6 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
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
Score
Last Scanned on 2025-07-14
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