Skip to content

Instantly share code, notes, and snippets.

@zhangyuan
Created July 13, 2017 08:41
Show Gist options
  • Select an option

  • Save zhangyuan/6146dc49930432bd17bdf9d5d6e9779e to your computer and use it in GitHub Desktop.

Select an option

Save zhangyuan/6146dc49930432bd17bdf9d5d6e9779e to your computer and use it in GitHub Desktop.
Test Coverage Configuration

nyc

nyc --check-coverage --lines 90 --functions 90 --branches 50 -r html -r clover -r text npm run test

https://github.com/istanbuljs/nyc

jest

In package.json

{
  "jest": {
    "coverageThreshold": {
      "global": {
        "branches": 50,
        "functions": 50,
        "lines": 50,
        "statements": 50
      }
    }
  }
}

https://facebook.github.io/jest/docs/configuration.html

nose

nosetests test --with-coverage --cover-html --cover-html --cover-min-percentage=85

react-scripts-app

npm test -- --coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment