Coverage for untested files?
See original GitHub issueHow do I use the coverage for untested files feature introduced in the 4.1.0 release? I reviewed the PR and it looks like I have to specify an onCover
function, however, I’m currently specifying my istanbul config via a .babelrc
file:
{
"env": {
"test": {
"plugins": [
[ "istanbul", {
"exclude": [
"tests/index.js",
"tests/testutils/**/*.js",
"**/*.spec.js"
]
}]
]
}
},
}
This has treated me very well so far, but it seems incompatible with the final version of this feature? (The originally proposed version seemed much more amenable, but alas was cut.) I’m running tests via karma, so have a karma config available if that helps.
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Disable Coverage on Untested Files - Jest - Stack Overflow
When using @vue/cli-plugin-unit-jest, I am receiving coverage reports each time I run my unit tests, regardless of whether I have the -- ...
Read more >Jest is "stuck" on only generating coverage for tested files ...
I've tried creating a whole new config, one with coverage and one without, and then just running the base command, and that doesn't...
Read more >Configuring code coverage in Jest, the right way
Code coverage makes possible to spot untested paths in our code. It is an important metric for determining the health of a project....
Read more >Full code-coverage with Jest - tsmx
The answer is that Jest will – by default – only collect coverage stats for touched source files. Without this empty suite referencing ......
Read more >Jest code coverage report explained - Emma Goto
How to track untested files with Jest's code coverage report ... By default, Jest will calculate coverage for each file that has a...
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 FreeTop 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
Top GitHub Comments
@marco-ramirez my example repo does everything @bcoe mentioned, it still does not work. It is using
istanbul
in it’s babelrc file. I callnyc --all ava
as suggested. And untested files are still not shown in the coverage report.For those, who use Karma + Istanbul – take a look on this plugin https://github.com/kopach/karma-sabarivka-reporter. Configuration is simple like that:
It works, as already mentioned above – by scanning your project files and adding them to coverage report.