From a7d468b48c35e968db6d44e8e97513eee2e01f4e Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Wed, 22 Mar 2017 14:27:30 -0700 Subject: [PATCH] Fix Jest coverage configuration for deeply-nested dirs. --- tasks/ui_framework_test.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tasks/ui_framework_test.js b/tasks/ui_framework_test.js index 0c2bf6da475ec..5bbf70b9d8d00 100644 --- a/tasks/ui_framework_test.js +++ b/tasks/ui_framework_test.js @@ -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: '/jest/report', coverageReporters: ['html'], moduleFileExtensions: ['jsx', 'js', 'json'],