jest --collect-coverage marks files as 100% covered even there is no test for them

Viewed 993

I am trying coverage feature on jest tests but output shows 100% coverage for files which are referenced by tests, but not covered at all.. mostly they are just dependencies of modules which are tested and I am far from using all exported methods from them. Any idea why I am getting this phantom coverage? Thanks for any hint

--------------------------------------|----------|----------|----------|----------|-------------------|
File                                  |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
--------------------------------------|----------|----------|----------|----------|-------------------|
All files                             |     6.93 |     5.48 |     3.22 |     7.18 |                   |
 src                                  |    10.11 |    10.53 |     5.88 |    10.11 |                   |
  const.ts                            |      100 |      100 |      100 |      100 |                   |
  utilities.ts                        |      100 |      100 |      100 |      100 |                   |
... etc

utilities.ts have meny exported methods but no one is tested yet and are counted as 100% covered :/

I did not google out any similar case. Most of people ask why their test coverage isnt 100% :D

0 Answers
Related