-
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
Only report coverage for TS files that have spec files? #116
Comments
Hey @jgodi, the only way to do it (currently) is excluding files using |
Yes, that would be amazing. I can hard-code the exclusion, but it would be nice to only include coverage for files that have tests with them. Especially in Angular, there are module files, index files, etc that only have decorators on a class. Testing these would provide no benefit, but including them reduces the numbers drastically. I would gladly help with a PR, if you want to point me in a good direction. |
Ok, so something like karmaTypescriptConfig {
coverageOptions: {
exclude: [/\.(d|module|spec)\.ts$/i, /index\.ts$/i]
}
} to exclude all If so, this would have to be an opt-in feature because it would mean that you could have 100% test coverage even with a ton of untested files, if all untested files are excluded automatically. These are good starting points for a PR:
Cheers! |
Just so you know, I prefer coverage to show for all files by default. I think it's better to make it harder to forget to test files by default. I'd rather have to explicitly exclude files. |
I have a few files in my library that don't need/have spec files and they are showing in my coverage report. How can I ignore these without specifically calling them out with the
exclude
?I only want the
meow.component.ts
to appear.The text was updated successfully, but these errors were encountered: