Partial code coverage or incorrect mapping
See original GitHub issue- Issue
Hi and thanks for all the job done for this library 👍
I have probably the same issue as https://github.com/kulshekhar/ts-jest/issues/339 but with a single repo. The solution pointed in the issue is not suitable in my case.
I either have an incorrect code mapping on coverage without "mapCoverage": true or missing files when this option is removed + an almost correct mapping.
Incorrect mapping + all files covered
------------------------------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
------------------------------|----------|----------|----------|----------|----------------|
All files | 83.33 | 100 | 66.67 | 75 | |
rnTsWithJest | 100 | 100 | 100 | 100 | |
App.tsx | 100 | 100 | 100 | 100 | |
Home.tsx | 100 | 100 | 100 | 100 | |
rnTsWithJest/core/locales | 0 | 100 | 0 | 0 | |
index.ts | 0 | 100 | 0 | 0 | 4 |
rnTsWithJest/core/locales/en | 100 | 100 | 100 | 100 | |
common.ts | 100 | 100 | 100 | 100 | |
index.ts | 100 | 100 | 100 | 100 | |
rnTsWithJest/core/locales/fr | 100 | 100 | 100 | 100 | |
common.ts | 100 | 100 | 100 | 100 | |
index.ts | 100 | 100 | 100 | 100 | |
------------------------------|----------|----------|----------|----------|----------------|
(Almost) Correct mapping + missing covered files
---------------------------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
---------------------------|----------|----------|----------|----------|----------------|
All files | 83.33 | 100 | 66.67 | 83.33 | |
rnTsWithJest | 100 | 100 | 100 | 100 | |
App.tsx | 100 | 100 | 100 | 100 | |
Home.tsx | 100 | 100 | 100 | 100 | |
rnTsWithJest/core/locales | 0 | 100 | 0 | 0 | |
index.ts | 0 | 100 | 0 | 0 | 5 |
---------------------------|----------|----------|----------|----------|----------------|
- Expected behavior
Having correct code mapping on coverage report without missing covered files.
Any help would be greatly appreciated.
- Minipal repo
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:36 (10 by maintainers)
Top Results From Across the Web
c# - MSTest Shows Partial Code Coverage on Compound ...
1 Answer 1 · So after some digging, when using && it seems that it doesn't consider code fully covered unless, given: A...
Read more >Code Coverage Tutorial: Branch, Statement, Function ...
This comprehensive tutorial explains what is Code Coverage in Software Testing, its types, benefits, and drawbacks:.
Read more >Code Coverage : Partially Covered line? is this really working?
To determine line coverage, we do the following: block 0 maps to lines 1 and 2 in the example, so lines 1 and...
Read more >Understanding Code Coverage - How to determine which ...
The “Code Coverage Analysis” tool provides an externally useful features by visually indicating the Covered, Partially Covered, Not Covered code block.
Read more >code quality - Best practice to avoid partial branches
You must distinguish between line coverage and branch coverage. Line coverage measures the percentage of lines that were executed, ...
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

Looks that after I upgrade to Jest 23.4.2 and ts-jest 23.1.3 the coverage is mapped correctly. Thank you guys!
@kulshekhar thanks for your fast reply 👍
I just shaved a lot of noise to make your work easier. Screenshots and reports have been updated too. Let me know if you need anything else to solve my issue.