-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code coverage not getting generated in headless mode. in 3.10.0 #611
Comments
Hello Omkar, I had this issue, and I saw we can get the coverage report by setting up the following environment variable.
The |
sadly I get |
If you run this command on your terminal, you may need to point to the cypress binary in the node_modules directory. Otherwise, your terminal might not find the cypress binary in the $PATH variable of your computer. Try to use that command by creating a script in the package.json. For instance:
|
For anyone experiencing similar the steps used to get this working headless in the pipeline for me included:
Using the documentation: https://docs.cypress.io/guides/tooling/code-coverage#Using-code-transpilation-pipeline prefixing the pipeline build command with NODE_ENV=e2e or BABEL_ENV=e2e will set the env variable and transpile the code using the configuration above for cypress tests only. |
Hi @omkar-nath , I realize this issue is quite old, but did @ojemuyiwa 's suggestion address your problem? |
Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen. |
My team also experiences issues with generating Cypress code coverage reports in our Jenkins pipeline (we are using Vite, instead of Babel/Webpack). It works totally fine locally with various formats (text, json, cobertura, html) in headless mode and with the UI (We are using nyc in version 15.1.0.). Did anybody find the cause and/or a solution for this? .nycrc
Calling with the following script by
|
Hi @SparksFlyx3 have you tried the suggestion in this comment? If that does not address your problem I would suggest either opening a new issue with a reproducible example or checking out the Cypress Discord Community Discord chat, it can be helpful for debugging or answering questions on how to use Cypress. |
Same issue, CLI/headless not working the way the runner did with "@cypress/code-coverage" Tried a bunch of this to no avail. I went with: Easy enough. Wish I thought of it sooner. Sort of seems safer and more foolproof anyway. Removes a vector for misleading reports. If anyone has a reason why this is a bad idea, I'd be curious! |
Hi, We are using cypress/code-coverage - 3.10.0 and Cypress 10.3.1. In interactive mode we are able to see code coverage but when run in headless mode.
I have tried with --headed option also but the result is same.
The text was updated successfully, but these errors were encountered: