I'm using Mochawesome with Cypress to generate reports.

I am consistently observing this error when I attempt to merge my individual Mochawesome test suite files into one combined report:

ERROR: Failed to merge reports

Error: Pattern --reportDir matched no report files

Here is how my package.json files looks:

  "name": "fe_automation",
  "version": "1.0.0",
  "description": "\"Sample Cypress UI tests\"",
  "main": "index.js",
  "scripts": {
      "clean:reports":"mkdir cypress\\reports\\ && mkdir cypress\\reports\\mocha\\ && mkdir cypress\\reports\\mochareports\\ ",
      "pretest":"npm run clean:reports",
      "scripts":"cypress run --spec 'cypress/integration/avitas/**/*' --headed",
      "merge-report":"mochawesome-merge --reportDir cypress/reports/mocha > cypress/reports/report.json",
      "generate-report":"marge cypress/reports/report.json -f report -o cypress/reports/mochareports",
      "posttest":"npm run merge-report && npm run generate-report",
      "test":"npm run scripts || npm run posttest"
  "author": "Srini",
  "license": "ISC",
  "devDependencies": {
    "cypress": "^4.4.0",
    "mocha": "^7.1.1",
    "mochawesome": "^6.1.0"
  "dependencies": {
    "cypress-multi-reporters": "^1.2.4",
    "mochawesome-merge": "^4.0.3"

Here is how my cypress.json looks:

"reporter": "cypress-multi-reporters",
    "reporterOptions": {

All the tests get executed without an issue, but this error pops up during the report Merge process. I've referred online and no one has any concrete solution. Please help me out.

2 Answers 2


Which version of mochawesome-merge are you using , in the new new version reportdir flag is not supported.

You have to use:

"merge-report":"mochawesome-merge  cypress/reports/mocha/*.json> cypress/reports/report.json",

Where, cypress is the folder in your current directory.




  • 1
    Yes this worked. Many thanks. I just removed the dots and made my merge-reports script loom like this: "merge-report":"mochawesome-merge cypress/reports/mocha/*.json> cypress/reports/report.json", . Works now.
    – srini
    Apr 21, 2020 at 7:09
  • @srini thanks I will update the answer
    – PDHide
    Apr 21, 2020 at 7:35
  • Thanks for useful information, What should be the command needs to b executed to run all the spec in integration folder and generate mochawesome report ?
    – Tej
    Aug 12, 2021 at 13:29

As previously answered, in version 4, mochawesome-merge removed the reportDir parameter. However, they replaced it with the files parameter. So, you do not need to resort to the using the > redirect style. Check out the "Migrating to v4" section of the mochawesome-merge Readme.

Their example shows replacing:

reportDir: "mochawesome-report",


files: ["./mochawesome-report/*.json"],

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.