-
Notifications
You must be signed in to change notification settings - Fork 3
Jest Test Coverage
Harry Turnbull edited this page May 28, 2020
·
1 revision
In jest.config.json:
{
"setupFiles": [
"<rootDir>/src/setupTests.js"
],
"testRegex": "/*.test.js$",
"collectCoverage": true,
"coverageReporters": [
"lcov"
],
"coverageDirectory": "test-coverage",
"coverageThreshold": {
"global": {
"branches": 0,
"functions": 0,
"lines": 0,
"statements": 0
}
},
"moduleDirectories": [
"node_modules",
"src"
]
}To get coverage report:
npm run test -- --coverage --watchAll=false