You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great 🌸‼ Except you'd really like your accomplishment to set the new standard for test coverage in this project. jest-coverage-ratchet just does that automatically by looking at your current coverage summary, comparing it to your specified coverage thresholds, and updating the minimum for any threshold that is higher in the summary.
So given the previous values, running this script will update your coverage thresholds specified in the jest key of package.json to the following values:
I recommend then using the binary jest-coverage-ratchet as part of a prepush hook.
Assumptions
I know what happens when you assume, but jest-coverage-ratchet makes the following assumptions about your project.
jest has been run for project at least once with --coverage so that there is a valid file at the path ./coverage/coverage-summary.json(alternatively pass a path with --coverageSummaryPath of ./your/path/to/coverage-summary.json)
jest configuration object is present in the package.json that specifies at least:
coverage thresholds(alternatively pass a path with --configPath of ./your/path/to/jest.config.json)
'json-summary' in your jest config's reporters list like so:
Should this tool support things like piping the coverage data in as an argument? Of course it should. If you want to build that and send a PR I will be all smiles 😀✨. If not then you probably see me do it eventually.
Questions?
Just submit an issue or a PR, I'm no elitist.
About
Uses jest coverage output to raise acceptable coverage threshold to current coverage