Coverage report incorrect
See original GitHub issueI’ve been trying to get jest to work properly with a Vue 2 + Vite project. Jest reports pass/fail as I would expect, but the coverage report seems incorrect. Link to the repro here: https://github.com/qkjosh/vue-jest-coverage
package.json
"devDependencies": {
"@babel/core": "7.18.5",
"@babel/preset-env": "^7.18.2",
"@vue/test-utils": "^1.2.2",
"@vue/vue2-jest": "^28.0.0",
"babel-jest": "28.1.1",
"jest": "28.1.1",
"jest-environment-jsdom": "28.1.1",
"vite": "2.9.12",
"vite-plugin-vue2": "^2.0.1"
}
Given an incomplete test suite, the coverage report indicates 100% coverage and seems to treat the whole SFC component as one statement. Do I have something completely misconfigured, or is the coverage report broken?
Issue Analytics
- State:
- Created a year ago
- Reactions:12
- Comments:29
Top Results From Across the Web
Code coverage report seems incorrect. Why? - Google Groups
The test code is: We can see that the method getUser has been tested and the getRecord.append statements have been covered. But sonar...
Read more >Getting incorrect coverage report for no matter what module ...
We have a product with multiple python scripts which executes as different processes, sub-processes, daemons and on apache using mod-wsgi.
Read more >Code coverage report shows incorrect class ... - YouTrack
Code coverage report shows incorrect class coverage percentage · Right click -> Run tests with coverage · Inspect coverage report · See class...
Read more >Incorrect coverage number reported by codecov - Bug Fixes
The local jacoco report (screenshot below) shows about 85% coverage. The problem is codecov reporting only 20% while jacoco reports 85%. image.
Read more >Incorrect coverage for Overall Code on feature branch
Issue summary: A feature branch containing small changes is not picking up the old code coverage for Overall Code.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
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
Using yarn we were able to fix this by locking both versions of
@babel/core
and@babel/generator
to7.17.9
(thanks to the suggestion from @udebella )We only use babel for jest so this doesn’t have any other side effects for us, YMMV.
works on vue3 too. thx @GrRivero @rklos