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": {
.
.
.
"test": "jest",
"coverage": "jest --coverage --no-cache",
},
That's all, we don't have anything else to do; let's just see it work!