I used following command to run my tests and get a coverage report:
jest --coverage
now I want to check whether percentage of coverage is more than 90% or not in my script file. what should I do ?
You can use the coverageThreshold
option in your Jest configuration:
https://jestjs.io/docs/en/configuration#coveragethreshold-object
{
...
"jest": {
"coverageThreshold": {
"global": {
"branches": 50,
"functions": 50,
"lines": 50,
"statements": 50
}
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With