Sajad Norouzi Sajad Norouzi - 1 year ago 191
Node.js Question

jest - Is there a way to check percentage of test coverage?

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 ?

Answer Source

Try using this options

  "jest": {
    "coverageThreshold": {
      "global": {
        "branches": 50,
        "functions": 50,
        "lines": 50,
        "statements": 50
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download