From cb63c092eb388ff89b797c84455cafd956fb490b Mon Sep 17 00:00:00 2001 From: Patrick Mackinder Date: Fri, 28 Oct 2016 13:47:08 +0100 Subject: [PATCH] Add collectCoverageFrom option to collect coverage on files without any tests. (#961) --- packages/react-scripts/utils/createJestConfig.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-scripts/utils/createJestConfig.js b/packages/react-scripts/utils/createJestConfig.js index 39c864ab8f4..17d414fc594 100644 --- a/packages/react-scripts/utils/createJestConfig.js +++ b/packages/react-scripts/utils/createJestConfig.js @@ -18,6 +18,7 @@ module.exports = (resolve, rootDir, isEjecting) => { const setupTestsFile = pathExists.sync(paths.testsSetup) ? '/src/setupTests.js' : undefined; const config = { + collectCoverageFrom: ['src/**/*.{js,jsx}'], moduleFileExtensions: ['jsx', 'js', 'json'], moduleNameMapper: { '^.+\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': resolve('config/jest/FileStub.js'),