-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Typescript bad coverage #1907
Comments
@jsynowiec when I try with an simple class without using react only with |
I have some more complex classes that extend others and still, coverage works. Only difference that I can see right now is the React library and jsx. Do you have type definitions? |
Yes, but I don't think that is the issue, but I don't know for sure. |
I think this is similar case to #1584, I was able to create proof-of-concept code snippet does remapping code coverage to generate correct test coverage, shows below differences. I hope jest supports hook for coverage processing as same as preprocessing compilation allows to create / or existing preprocessor integrates coverage remapping as well. (Maybe it's already available but I didn't noticed?) Anyone interested can look code snippet at https://github.com/kwonoj/jest-typescript-coverage. |
I got an solution for this, basically what I do is using an custom typescript processor and change the target from
|
I was using target |
That's weird then, can you try replicate in a clean repository an give the link to see if I can help in some way? |
You can use the active repo react-themeable-ts. |
@beckend after tried in my own application you're right and didn't solve my solution. Could this to be done in karma or another tool? |
Anyone interested in this topic can refer kulshekhar/ts-jest#25 as well, I've managed code coverage remapping works with
|
TypeScript support in Jest is not "officially" supported by us. I recommend using @kwonoj feel free to send PRs to solve any of the problems you outlined above if that will help you have better coverage support. |
|
@alexgorbatchev thanks for this, it's not mentioned well enough in the docs! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Do you want to request a feature or report a bug?
BUG
What is the current behavior?
Right now when I execute the jest command and it never give me 100% of coverage.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal repository on GitHub that we can
![screen shot 2016-10-10 at 5 58 40 pm](https://cloud.githubusercontent.com/assets/1266477/19244237/3ff22690-8f13-11e6-8e9c-ae0f86322132.png)
npm install
andnpm test
.I created an simple example with the bug: Repository
Is just
npm install
and after thatnpm test
and if you guys see the coverage report it appears 87.5% and if you guys open the coverage report in the browser you guys see the issue that I'm having.What is the expected behavior?
That the coverage it will be at 100%
The text was updated successfully, but these errors were encountered: