When all spec.js files passes raport is generated and everything is okey. When just one or more of tests fails there is something weird going on. There is many warnings and errors but still report is generated. Also report seems to be generated twice (only on faill). Why?
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cypress-tests@1.0.0 scripts-chrome: `cypress run --browser chrome`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cypress-tests@1.0.0 scripts-chrome script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Dawid\AppData\Roaming\npm-cache\_logs\2021-11-02T07_12_01_140Z-debug.log
> cypress-tests@1.0.0 posttest-chrome E:\Cypress
> npm run combine-reports-chrome && npm run generate-report-chrome
> cypress-tests@1.0.0 combine-reports-chrome E:\Cypress
> mochawesome-merge cypress/reports/current/mocha/*.json > cypress/reports/current/chrome/mochareports/report.json
> cypress-tests@1.0.0 generate-report-chrome E:\Cypress
> marge cypress/reports/current/chrome/mochareports/report.json -f report -o cypress/reports/current/chrome/mochareports
✓ Reports saved:
E:\Cypress\cypress\reports\current\chrome\mochareports\report.html
> cypress-tests@1.0.0 posttest-chrome E:\Cypress
> npm run combine-reports-chrome && npm run generate-report-chrome
> cypress-tests@1.0.0 combine-reports-chrome E:\Cypress
> mochawesome-merge cypress/reports/current/mocha/*.json > cypress/reports/current/chrome/mochareports/report.json
> cypress-tests@1.0.0 generate-report-chrome E:\Cypress
> marge cypress/reports/current/chrome/mochareports/report.json -f report -o cypress/reports/current/chrome/mochareports
✓ Reports saved:
E:\Cypress\cypress\reports\current\chrome\mochareports\report.html
PS E:\Cypress>
This is my code for generating reports
"scripts": {
"clean:reports-chrome": "rmdir /S /Q cypress\\reports\\current && mkdir cypress\\reports\\current\\chrome\\mochareports",
"pretest-chrome": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command ./pretest.ps1 && npm run clean:reports-chrome",
"scripts-chrome": "cypress run --browser chrome",
"combine-reports-chrome": "mochawesome-merge cypress/reports/current/mocha/*.json > cypress/reports/current/chrome/mochareports/report.json",
"generate-report-chrome": "marge cypress/reports/current/chrome/mochareports/report.json -f report -o cypress/reports/current/chrome/mochareports",
"posttest-chrome": "npm run combine-reports-chrome && npm run generate-report-chrome",
"test-chrome": "npm run scripts-chrome || npm run posttest-chrome",