question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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 |                |
------------------------------|----------|----------|----------|----------|----------------|
capture d ecran 2017-11-13 a 10 09 52

(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 |
---------------------------|----------|----------|----------|----------|----------------|

capture d ecran 2017-11-13 a 10 10 18
  • Expected behavior

Having correct code mapping on coverage report without missing covered files.

Any help would be greatly appreciated.

  • Minipal repo

https://github.com/momsse/rnTsWithJest

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:7
  • Comments:36 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
andriolicommented, Aug 10, 2018

Looks that after I upgrade to Jest 23.4.2 and ts-jest 23.1.3 the coverage is mapped correctly. Thank you guys!

3reactions
momssecommented, Nov 12, 2017

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found