It is very useful to track coverage status changes after commits:
- It reveals risky changes early
- It gives a clear warning to go ahead and fix it before it gets out of hand
For this example, we will use a free service called Coveralls:
$ npm install react react-dom --save$ npm install coveralls jest next react-test-renderer --save-dev
Same as before; we need to configure Babel too:
// .babelrc{ "env": { "test": { "presets": [ [ "env", { "modules": "commonjs" } ], "next/babel" ] }, "development": { "presets": [ "next/babel" ] } }}
Let's configure Jest to collect coverage for us:
// jest.config.jsmodule.exports = { testPathIgnorePatterns: [ './.idea', './.next', './node_modules' ], collectCoverage: true, ...