gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 787 forks source link

Unreadable coverage report with typescript #754

Open thomasthiebaud opened 7 years ago

thomasthiebaud commented 7 years ago

I'm running the following command to try to get the coverage report of a typescript project

"test:coverage": "istanbul cover -e .ts -x '*.spec.ts' _mocha -- 'src/**/*.spec.ts' --compilers ts:ts-node/register",

It get some results

image

but when I in the report I see

image

Which makes no sense. Is it a bug ? Did I miss something ?

avik-so commented 7 years ago

I'm currently using typescript and jenkins-mocha to successfully generate and view these reports. I would check to see if there is a browser issue, or if you can replicate it consistently in a test repo.

WojtekF commented 7 years ago

Hi @avik-so, I'm having the same issue. I've created a repo with test project. After installing app please run "npm run jest". After all, the coverage report will be created.

https://github.com/WojtekF/test-repo

image for evidence.

image

avik-so commented 7 years ago

I don't have tsx files in my project. Could that be the issue?

WojtekF commented 7 years ago

Well, that's weird. There is one tsx file there https://github.com/WojtekF/test-repo/blob/master/src/DispatchableButton.tsx

WojtekF commented 7 years ago

Hi @avik-so,

Can you tell me if there is any work ongoing regarding this issue? Did anyone looked into it? Can @thomasthiebaud and myself expect it to be fixed?

avik-so commented 7 years ago

Sorry, no idea, I don't work on this project. I was just trying to help isolate the bug.

blackcater commented 7 years ago

I have the same issue. 😢