Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the
collectCoverageoption to thejestfield inpackage.json, which tells it to collect test coverage stats. By default, Jest generates a report on stdout upon completion, which I'd like to see on Travis before moving forward with trying to improve coverage in a separate PR to eventually do #90.What is code coverage? It's really just a measure of how many lines and/or statements of your code are "touched" (run) by your test suite. For instance, if one of our components did something different when
props.foo === "bar"and our tests never passfoo="bar", then the statements in that branching condition will be subtracted from the total. So if we had 100 statements and there were two in thatifstatement, our coverage could never exceed 98% until we added tests for that condition.Side note: having configured projects to use Coveralls and CodeCov, it's so refreshing to have coverage built into Jest and be able to generate a report by just adding a flag to the configuration. We can even configure it to fail our CI builds if coverage drops below a threshold, either overall or on a per-file basis! ✨
This PR also includes a fix for #97 and a new section in the README about code coverage.