-
Notifications
You must be signed in to change notification settings - Fork 109
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
Support for c8 code coverage as an option #588
Comments
Closing as invalid, I've just seen that this (or the general premise of removing Istanbul installation) is being worked on. |
For reference, the future work section in the documentation has been removed (cypress-io/cypress-documentation@280dccb) so this is unfortunately not planned anymore. |
Hi all. After an email exchange with @jennifer-shehane she confirmed to me that there were no more plans to implement c8/v8 coverage for Cypress from the internal team and the commit linked above was created to remove it. Since then, I was working hard to make this work. I'm happy to say I have an initial working package published to NPM for V8 code coverage support for Cypress! NPM: https://www.npmjs.com/package/cypress-code-coverage-v8 We have been using it internally at our company for our Vite + React application for over 6 months and it has served us well. Please take a look and let me know what you think! The ultimate goal would be for this to be an official Cypress plugin :) have sparked a new discussion here to maybe get the ball rolling: #925 |
Is your feature request related to a problem? Please describe.
Code coverage using istanbul / nyc requires implementing an extra build step to instrument your code, but c8 uses native V8 coverage metrics in any version since Node.js >= 10.12.0, which doesn't require instrumenting your code.
Describe the solution you'd like
Support for using coverage reports generated only using c8, removing the need to install istanbul and nyc into the build tool.
I believe this is possible as an option because vitest supports both istanbul and c8 via different coverage plugins, so theoretically, it's possible. That being said, I am not well versed on coverage tools, so it's entirely possible I'm asking for the moon here, let me know if that's so.
Also, based on the fact that cypress doesn't load the code for you, you must start your own server, this could mean that it requires starting the server with c8 to ensure it's generating the reports needed by cypress, but as long as cypress can read the reports, and documents that the server must be started a certain way, I don't see this as an issue.
e.g. my app is a remix app, so I'd have to load the app using
c8 remix dev
instead ofremix dev
for this to work.The text was updated successfully, but these errors were encountered: