You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we don't know how much of our code is covered by tests.
After some setup work, we can run Jest with the --coverage true flag to get a Coverage Summary at the end of the run:
=============================== Coverage summary ===============================
Statements : 100% ( 24413/24413 )
Branches : 98.11% ( 7964/8117 )
Functions : 100% ( 2919/2919 )
Lines : 100% ( 23986/23986 )
================================================================================
Test Suites: 385 passed, 385 total
Tests: 6978 passed, 6978 total
Snapshots: 2002 passed, 2002 total
Time: 600.264 s
Ran all test suites.
What problem will this feature solve?
Know which parts of code are covered by tests.
Once we have covered enough of our code with tests, we can set coverageThreshold1 in Jest. This means that future code should always be covered with tests, or the coverage will drop below the threshold and Jest will fail the tests.
Do you want to help make the feature?
Yes
Is there anything else we need to know?
The Jest documentation explains how to set up the coverage reports.
What feature would you like to have?
Currently we don't know how much of our code is covered by tests.
After some setup work, we can run Jest with the
--coverage true
flag to get a Coverage Summary at the end of the run:What problem will this feature solve?
Know which parts of code are covered by tests.
Once we have covered enough of our code with tests, we can set
coverageThreshold
1 in Jest. This means that future code should always be covered with tests, or the coverage will drop below the threshold and Jest will fail the tests.Do you want to help make the feature?
Yes
Is there anything else we need to know?
The Jest documentation explains how to set up the coverage reports.
https://jestjs.io/docs/configuration
Footnotes
https://jestjs.io/docs/configuration#coveragethreshold-object ↩
The text was updated successfully, but these errors were encountered: