Skip to content

Commit

Permalink
Jest configuration: added settings for code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
gianantoniopini committed Jan 4, 2021
1 parent 8202ca5 commit 57d234a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 18 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -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`,
},
Expand Down

0 comments on commit 57d234a

Please sign in to comment.