-
Notifications
You must be signed in to change notification settings - Fork 16
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
Include all files in coverage report, not just the ones with test against them #28
Comments
This could be a tricky issue. As this goes against how Vite works. I'm not really sure if there is a way around this but i would imagine that this is not really possible at the moment. |
After thinking about this for a while, i think this is not really do to this plugin and rather what reporter is used and how it is configured. I don't have any experience with parallel tests, but would it not be the goal of the reporter to include the files that are not covered. As this plugin is only for instrumenting code and not for generating reports. Have you tested the following: https://github.com/cypress-io/code-coverage#include-code, also check the note here: https://github.com/cypress-io/code-coverage#exclude-files-and-folders.
|
Thanks. I already had the setup described in the Cypress links you provided, but it does not work with your plugin. It did work with Webpack and Istanbul plugin. But I do not think the reporter can count covered / not covered lines / branches. Reporter are just reading So the trick could be to initialize |
Actually, this is also discussed on Cypress side: cypress-io/code-coverage#539 |
My workaround is to disable chunk-splitting in Vite using:
Otherwise with code splitting, Vite only parses the code files loaded by the tests. |
I also am using Cypress with Vite + this plugin (all of this in a docker container) and wanted to achieve the same as @yann-combarnous . However the solution posted above did not work for me. @yann-combarnous if possible, could you explain your approach a bit further? I have a feeling that I am doing something wrong. Just to be more specific about my question, below is what would like to know:
|
Closed due to inactivity |
We use Cypress for testing with Vite + this plugin, and run our tests in parallel.
As a tester, I would like to be able to get a global code coverage for all files selected by include/exclude options, not just the ones that have already tests against them.
So if include/exclude results in files A, B and C, and my tests just cover file C, I want to see the code coverage for A, B and C, not just C.
NYC supports this option through the --all flag, see https://github.com/istanbuljs/nyc#selecting-files-for-coverage . This also seems supported by Istanbul Instrumenter Loader, see https://www.npmjs.com/package/istanbul-instrumenter-loader .
Not having this option is breaking running tests in parallel with Codecov or Coveralls, for instance, as merged reports are missing for different untested files in each test group.
The text was updated successfully, but these errors were encountered: