-
Notifications
You must be signed in to change notification settings - Fork 90
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
Code coverage reports altered - 100% coverage not possible anymore #95
Code coverage reports altered - 100% coverage not possible anymore #95
Comments
I've had this problem using normal rewireify too. There is a solution in wrapping the rewireify lines with |
@albertogasparin see pull request here: i-like-robots/rewireify#22 |
So it looks like this PR was proposing the right solution: #52 |
@albertogasparin From my point of view it will be considered. But we first of to ship a working version with babel 6 support. I hope this answer is not too disappointing for you. |
I still have my same concern. It seems like it shouldn't be the responsibility of this plugin to add specific code to support all other plugins. If we add comments to our code to ignore istanbul and another thing comes along, we shouldn't have to continuously modify this plugin. As a possible solution to this, I could imagine another plugin that runs before this one that adds a comment to the beginning and end of the user's real code. That plugin and those comments could be specific to istanbul to ignore other things. |
@TheSavior what about a pluggable approach, Providing a hook, for generating comments on generated code? So it is the responsibility of the plugin using this hook to generate the correct comment. |
Hmm. I'm not familiar with babel plugins providing hooks to other babel plugins. Is that what you are proposing? |
@TheSavior I agree with you about how it isn't the plugins responsibility. It also feels very hacky to be squirting in comments defined by a user in a config file or as a hook for other plugins to latch onto. The only way I know of which would negate the need for these comments is to process the files, write them to a location then load them with istanbul afterwards. I have that working but it is significantly slower. |
@culshaw sorry for the extremely long delay. I changed your sample project to use babel-plugin-istanbul and the resulting code coverage is 100% on all levels. Therefore I will close this issue for now. If this doesn't solve your problem please feel free to reopen this issue |
babel-plugin-rewire
instrumentation is not ignored by istanbul (and as a consequence it affects also isparta, nyc, etc). So, reports are wrong and it is no longer possible to get 100% code coverage, even if the source code gets properly tested.The issue is even more accentuated when babel option
retainLines: true
is set.I have created a clean test project to let you play around: babel-plugin-require-coverage
The text was updated successfully, but these errors were encountered: