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.
Top comments (2)
Hi There,
On windows, we have "marge" not "merge", Please update that and try. I am able to generate reports.
I am getting the same issue?
Anyone can help me with this?