Daniel Hoelbling-Inzko talks about programming
create-react-app is a nice and easy way to bootstrap a new React.js project with some sane defaults and most of the tedious configuration required to enable Webpack building of Babeljs etc..
One thing I was missing from the generated configs though is how to output code coverage. Turns out it's rather simple - locate your package json and add the following line under scripts
:
{ "coverage": "node scripts/test.js --env=jsdom --coverage" }
This way you can run yarn coverage
or npm coverage
and get a nicely formatted output with your coverage data. You can read more about the jest cli options in the docs