-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Out of the box test coverage is not 100% #1386
Comments
Does |
It doesn't - but it seems like if code coverage is something that is a huge benefit, it'd be great to start folks off with 100% coverage. For the life of me, all the googling I did regarding Jest and configuration options didn't seem to matter one bit for this. |
Thanks for the issue! I understand where you're coming from, but in real apps the goal of 100% test coverage is often unrealistic and encourages people to create brittle tests that aren't very useful. I think it’s fine to leave this as is, but I appreciate your opinion. |
You can exclude index.js from coverage reporting. I remedied the problem by adding
https://facebook.github.io/jest/docs/configuration.html#coveragepathignorepatterns-array-string |
@wasifhyder thanks, this looks promising. This isn't working for me though. I added what you mentioned above in |
I'm experiencing the same issue. I can't tell if these Jest configs work on an unejected app at all. edit: However I did have luck adjusting the CLI script. Adding this flag worked for me |
I did this after ejecting react. Haven't tried without ejecting, so can't say for sure how this will behave. |
Coverage collection is configurable in the next version. |
Please help beta test the new version that includes this change! |
I love this as a starting point for React apps, but I am puzzled by one thing...Having Jest and test coverage built in is awesome, but why isn't coverage 100% out of the box?
If I run the test coverage report, I see:
It'd be great to start folks off with 100% tested code - no matter how trivial the index.js file is =)
The text was updated successfully, but these errors were encountered: