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
Ensure incremental coverage gains are not lost, and positively reinforce good testing habits. Automatically bump up global Jest thresholds whenever coverage goes above them.
jest-it-up exposes a standalone CLI tool (see options), but you most likely want to use it in a post-test script.
Within package.json:
{"scripts": {"test": "jest --coverage",// or set `collectCoverage` to `true` in Jest config"posttest": "jest-it-up"// must run from the same directory as `jest.config.js`}}
within jest.config.js:
module.exports={coverageReporters: ['json-summary',// plus any other reporters, e.g. "lcov", "text", "text-summary"],coverageThreshold: {global: {branches: 0,// or your current numbersfunctions: 0,lines: 0,statements: 0,},},}
Once tests finish running, jest-it-up will update configured thresholds to match higher coverage numbers, if any.
Options
$ jest-it-up --helpUsage: jest-it-up [options]Options: -c, --config <path> path to a Jest config file (default: 'jest.config.js') -m, --margin <margin> minimum threshold increase (default: 0) -t, --tolerance <tolerance> threshold difference from actual coverage -i, --interactive ask for confirmation before applying changes -s, --silent do not output messages -d, --dry-run process but do not change files -v, --version output the version number -p, --precision number of threshold decimal places to persist -h, --help display help for command
About
🌐📈 Automatically bump up global Jest thresholds whenever coverage goes above them