Getting Error mochawesome-merge error: unknown option: --reportDir

Viewed 1639

On merging JSON reports through cmd, I am getting error in report.json(converted one)

error: unknown option: --reportDir

Used below command

run mochawesome-merge --reportDir cypress\reports\mochawesome-report  > cypress\reports\mocha\report.json

Used: os: Windows

"devDependencies": {
    "cypress": "^4.2.0",
    "cypress-multi-reporters": "^1.2.4",
    "mocha": "^7.1.1",
    "mochawesome": "^5.0.0",
    "mochawesome-merge": "^3.0.0",
    "mochawesome-report-generator": "^4.1.0"
  },

  "reporter": "mochawesome",
  "reporterOptions":{
      "reportDir": "cypress/reports/mochawesome-report",    
      "reportFilename": "CustomeMocaReport",
      "quiet": true,
      "overwrite": false,
      "html": false,
      "json": true  

  },
1 Answers

I think your first command run was not recognized so I suggest you to use npx instead

npx mochawesome-merge --reportDir cypress\reports\mochawesome-report  > cypress\reports\mocha\report.json

if it will not work check the path, I think you have a problem there with slash because in your cypress.json you use normal slash / but in command backslash \ !

Related