OK, so you have written a lot of tests, but how much of your code base are you actually testing? This measure of the quality (breadth) of your testing is called coverage, and it's easy to determine; in this recipe, let's find out how to do this. Fortunately, given all the work that we have done, it will be a very simple recipe.
Measuring your test coverage
How to do it...
To have Jest produce a coverage report, showing what parts of your code were (and weren't) covered by your tests, all you have to do is add a pair of parameters to the corresponding script in the package.json file:
"test": "jest out/ --coverage --no-cache"
In the preceding line of code, the first parameter, --coverage...