Skip to content

Commit

Permalink
Fix Jest coverage configuration for deeply-nested dirs.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal committed Mar 22, 2017
1 parent f7f170b commit a7d468b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tasks/ui_framework_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ const resolve = relativePath => path.resolve(__dirname, `..`, ``, relativePath);
const config = {
rootDir,
collectCoverage: true,
collectCoverageFrom: ['components/**/*.js', '!components/index.js', '!components/**/*/index.js'],
collectCoverageFrom: [
'components/**/*.js',
// Seems to be a bug with jest or micromatch, in which the above glob doesn't match subsequent
// levels of directories, making this glob necessary.
'components/**/**/*.js',
'!components/index.js',
'!components/**/*/index.js',
],
coverageDirectory: '<rootDir>/jest/report',
coverageReporters: ['html'],
moduleFileExtensions: ['jsx', 'js', 'json'],
Expand Down

0 comments on commit a7d468b

Please sign in to comment.