We already saw how to get coverage for Jest tests back in the Measuring your test coverage section of Chapter 5, Testing and Debugging Your Server, so in this recipe, we'll just go over some small changes that we'll be making to the test.
Measuring test coverage
How to do it...
We want to measure how thorough our testing is, so let's look at the necessary steps. When working with Node, we directly invoked the jest command. Here, however, as the application was built by create-react-app, we'll have to work a bit differently. We'll have to add a new script to package.json that will invoke our tests with extra parameters:
"scripts": {
.
.
.
"test": "react-app-rewired...