Friday, May 17, 2024
189
rated 0 times [  195] [ 6]  / answers: 1 / hits: 16380  / 5 Years ago, mon, february 18, 2019, 12:00:00

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 --coverage flag in the execution line or not. I do not want to receive coverage reports on all of my untested files. When searching for an answer online, there are numerous questions about how to turn that feature on, not turn it off. I can't find it in the documentation either.



How do you disable the Coverage on Untested Files feature in Jest?


More From » unit-testing

 Answers
28

Disabling coverage similar to enabling it, just prefix the pattern with an ! like so:



{
collectCoverageFrom: [
**/*.{js,jsx},
!**/node_modules/**,
!**/folder-with-untested-files/**
]
}


Or disable coverage all together with collectCoverage: false.
If that does not work, then you have this params overridden somewhere in your code.


[#52575] Wednesday, February 13, 2019, 5 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mustafaericho

Total Points: 322
Total Questions: 103
Total Answers: 110

Location: Montenegro
Member since Thu, Jun 16, 2022
2 Years ago
mustafaericho questions
Mon, May 31, 21, 00:00, 3 Years ago
Sun, May 23, 21, 00:00, 3 Years ago
Sat, Feb 13, 21, 00:00, 3 Years ago
Sat, Jan 2, 21, 00:00, 3 Years ago
Thu, Nov 12, 20, 00:00, 4 Years ago
;