Open elangoRamar opened 5 months ago
I am trying to generate the cypress code coverage report when i run the tests on a headless mode. But it's not generating the report.
And it's creating the report on interactive mode(cypress open -e2e).
(cypress open -e2e)
Vue project dependency version: "vue": "^3.4.21", "vite": "^5.2.7",
And i am using "nyc": "^15.1.0" and "vite-plugin-istanbul": "^6.0.0" to generate the report.
"nyc": "^15.1.0"
"vite-plugin-istanbul": "^6.0.0"
Even i tried adding "@istanbuljs/nyc-config-typescript": "^1.0.2" and .nycrc configuration also not working.
"@istanbuljs/nyc-config-typescript": "^1.0.2"
.nycrc
No response
vite.config.ts
export default defineConfig({ plugins: [ vue(), vuetify({ autoImport: true }), istanbul({ cypress: true, include: ['src/*'], exclude: ['node_modules'], extension: ['.js', '.ts', '.vue'], requireEnv: false }) ], build: { sourcemap: true, } });
cypress.config.js
import coverageTask from "@cypress/code-coverage/task";
export default defineConfig({ e2e: { setupNodeEvents(on, config) { coverageTask(on, config) return config; } } });
cypress/support/e2e.ts import '@cypress/code-coverage/support'
import '@cypress/code-coverage/support'
command: cypress run --e2e
cypress run --e2e
13.7.2
20.12.0
macOs 14
getting below message, Cannot find coverage file /Users/<user>/Documents/<project>/.nyc_output/out.json Skipping coverage report
I know there’s some comments in this thread about getting code coverage setup for ct testing, some of it may help you with a workaround. https://github.com/cypress-io/code-coverage/issues/596
Current behavior
I am trying to generate the cypress code coverage report when i run the tests on a headless mode. But it's not generating the report.
And it's creating the report on interactive mode
(cypress open -e2e)
.Vue project dependency version: "vue": "^3.4.21", "vite": "^5.2.7",
And i am using
"nyc": "^15.1.0"
and"vite-plugin-istanbul": "^6.0.0"
to generate the report.Even i tried adding
"@istanbuljs/nyc-config-typescript": "^1.0.2"
and.nycrc
configuration also not working.Desired behavior
No response
Test code to reproduce
vite.config.ts
cypress.config.js
import coverageTask from "@cypress/code-coverage/task";
cypress/support/e2e.ts
import '@cypress/code-coverage/support'
command:
cypress run --e2e
Cypress Version
13.7.2
Node version
20.12.0
Operating System
macOs 14
Debug Logs
Other
No response