In the same way we did for Node and React, back in Chapter 5, Testing and Debugging Your Server, and Chapter 10, Testing Your Application, we would like to have a measure of the coverage of our tests to see how thorough we have been, and to be able to detect pieces of code that need more work. Fortunately, we'll be able to manage with the same tools that we did before, so this recipe will prove easy to implement.
Measuring test coverage
How to do it...
The setup for the application done by CRAN included Jest, as we saw, and Jest provides us with the coverage option we need. To start, we'll have to add a simple script, to run our suite of tests with a couple of extra parameters:
"scripts": {
.
.
...