Measure code coverage for TypeScript instead of JavaScript
balazsbotond opened this issue · 14 comments
Our current method for measuring code coverage is rather limited. First, it works on the JavaScript output instead of the original TypeScript; second, it also measures coverage for the tests themselves. The only thing it should measure is src/index.ts
. The output should be in LCOV format so we can feed it into coveralls.
I have created the current solution in a hurry; I have no time to dig deeper into how TS code coverage measurement works. I would love to learn from someone who is more experienced or simply just has the time to do this properly.
NOTE: please only work on this if you either have experience in this area or are willing to learn about it without much handholding and are able to produce a nice, clean solution.
Thank you!
Do you mean generating a report of line coverage, branch coverage, etc . We can use jest for that right?
We already measure code coverage but the configuration is less than optimal due to the problems I mentioned in the issue description. I don't know jest but it looks like it can generate coverage reports for TypeScript so it might be a good solution.
An HTML report would be nice but the LCOV report is the main thing here, that's what gets fed to coveralls (as you can see in package.json
).
Oh, I didn't know the label had to be capitalized. I'll rename it, thanks for pointing it out.
JEST provides LCOV report itself in HTML report.
DOCS reference: https://jestjs.io/docs/en/configuration#coveragereporters-arraystring--string-options
Sounds great, thanks!
I can't assign this issue to you on my phone but feel free to start working on it.
Okay then I will start working on it and will keep you updated.
The exact issue is described in my first comment here.
Oh I think I misunderstood it.
I am sorry.
I think you should keep the issue open so that others can also pitch meanwhile I will try n understand more.
Sorry again.
@praveen5959 It's ok, thank you for offering your help and looking into it :)
To clarify: this issue is still open and we are still looking for someone who can help.
Solved in #44. Closing.