No way to ignore directory in "coveragePathIgnorePatterns"
See original GitHub issueDo you want to request a feature or report a bug? Bug
What is the current behavior? When running Jest code coverage test, I’m unable to ignore a complete folder in “coveragePathIgnorePatterns”.
"jest": {
"collectCoverage": true,
"coverageDirectory": "coverage/",
"collectCoverageFrom": [
"app/**/*.js"
],
"coveragePathIgnorePatterns": [
"app/index.js",
"app/modules/**/*.js"
]
},
As shown above app/modules/**/*.js isn’t supported by Jest.
What is the expected behavior? It should be possible to ignore one or many folders in the code coverage test.
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system. Jest: v20.0.4 Node: v8.4.0 Yarn: 1.0.1
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (1 by maintainers)
Top Results From Across the Web
How can I ignore a file pattern for Jest code coverage?
I use an external JSON file to hold my Jest configuration and run it from my package.json using npm: jest --config jest.config.json --no- ......
Read more >Configuring Jest
The directory where Jest should output its coverage files. coveragePathIgnorePatterns [array<string>]. Default: ["/node_modules/"]. An array of regexp pattern ...
Read more >Jest ignore or exclude file/function/statement from test coverage
This post goes through how to ignore files, functions, lines and statements from coverage in Jest using configuration or istanbul pragmas.
Read more >Configuring package.json · Jest
The directory where Jest should output its coverage files. coveragePathIgnorePatterns [array<string>] #. Default: ["/node_modules/"]. An array of regexp pattern ...
Read more >Jest setup | React Made Native Easy
For all those who have not heard about Jest, have a quick look here: ... coveragePathIgnorePatterns : Defines the files which we want...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@dougbacelar I think what you want is “testPathIgnorePatterns” instead of “coveragePathIgnorePatterns”
@mlpereira
think
testPathIgnorePatternsis to prevent tests from being ran, while i really only want to ignore files such assetupTests.jsfrom appearing on the coverage report.I also tried
collectCoverageFromwith no luck.I think those properties are being overridden somehow somewhere.