I am getting error while trying for mochawesome-merge(merging the .json file) in cypres on window 10 os

mayankjain2020

Mayank Jain

Posted on June 29, 2020

I am getting error while trying for mochawesome-merge(merging the .json file) in cypres on window 10 os

I am getting below error while trying for mochawesome-merge(merging the .json file).

SyntaxError: cypress/reports/output.json: Unexpected end of JSON input
at JSON.parse ()
at C:\Mayank\Cypress_Code\node_modules\jsonfile\index.js:33:18
at C:\Mayank\Cypress_Code\node_modules\graceful-fs\graceful-fs.js:123:16
at FSReqCallback.readFileAfterClose as oncomplete

Please find below package.json file

{
"name": "cypress_practice",
"version": "1.0.0",
"description": "This is for cypress practice",
"main": "index.js",
"scripts": {
"cypress:open": "cypress open",
"merge":"mochawesome-merge cypress/reports/*.json > cypress/reports/output.json",
"generate_mochawesome_report":"mochawesome-report-generator cypress/reports/output.json --reportDir ./ --inline",
"final_report": "npm run merge && npm run generate_mochawesome_report"
},
"author": "Mayank Jain",
"license": "ISC",
"devDependencies": {
"cypress": "^4.8.0",
"cypress-file-upload": "^4.0.7",
"mochawesome": "^6.1.1",
"mochawesome-merge": "^4.1.0",
"mochawesome-report-generator": "^4.1.0"
}
}

Please find below cypress.json file

{
"chromeWebSecurity": false,
"defaultCommandTimeout": 10000,
"execTimeout": 60000,
"pageLoadTimeout": 60000,
"requestTimeout": 15000,
"responseTimeout": 15000,

"reporter": "mochawesome",
"reporterOptions": {
  "reportDir": "cypress/reports",
  "reportFilename": "report",
  "overwrite": false,
  "html": true,
  "json": true,
  "charts": true
},
"video": false

Please help me on above issue.

💖 💪 🙅 🚩
mayankjain2020
Mayank Jain

Posted on June 29, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related