Jest configuration: added settings for code coverage

This commit is contained in:
gianantoniopini 2021-01-04 12:09:04 +01:00
parent 8202ca5461
commit 57d234ae02
2 changed files with 21 additions and 0 deletions

3
.gitignore vendored
View File

@ -20,6 +20,9 @@ coverage
# nyc test coverage
.nyc_output
# Coverage directory used by Jest
test-coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

View File

@ -1,4 +1,22 @@
module.exports = {
testRegex: '/*.test.js$',
collectCoverage: true,
collectCoverageFrom: [
'**/*.{js,jsx}',
'!\\.cache/**',
'!node_modules/**',
'!public/**',
],
coverageReporters: ['lcov'],
coverageDirectory: 'test-coverage',
coverageThreshold: {
global: {
branches: 0,
functions: 0,
lines: 0,
statements: 0,
},
},
transform: {
'^.+\\.jsx?$': `<rootDir>/jest-preprocess.js`,
},