Ratchet up code coverage - keep test coverage going only one direction -- up
Jest-Ratchet is a coverage watcher for Jest. Everytime a new level of coverage is reached Jest-Ratchet will automatically update the coverageThreshold.
npm
npm install jest-ratchet --dev
yarn
yarn add jest-ratchet --dev
Add jest-ratchet
to the reporters
section. And also ensure that collectCoverage
is enabled and json-summary
is added to the coverageReporters
.
{
"collectCoverage": true,
"coverageReporters": [ "json-summary" ],
"reporters": [ "jest-ratchet" ]
}