-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
added filter for statement statistics that contain null entries #40
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a fantastic contribution! Thank you :) and would love to see more in the future.
statementMeta = fileCoverage.statementMap; | ||
Object.keys(statementStats).forEach(function (stName) { | ||
var statementStats = Object.keys(fileCoverage.s).filter(function (stName) { | ||
return fileCoverage.s[stName] !== null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be overly poor form to use != null
to capture any ones that are undefined
as well? or would it be overkill to do && !== undefined
?
var statementStats = Object.keys(fileCoverage.s).filter(function (stName) { | ||
return fileCoverage.s[stName] !== null; | ||
}), | ||
statementMeta = fileCoverage.statementMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be a var statementMeta
line instead of the comma-list-declaration syntax, it's kind of hard to grok imho.
@JaKXz I'm pretty sure that in normal circumstances, getting a @SamNelson are you able to share the codebase that you were bumping into issues on? I think if we switch the order of |
@bcoe wouldn't it be good to have this passing anyways? in case there are other scenarios where there are null entries in statement statistics? |
@JaKXz the problem is it would result in misreporting test coverage information -- except in bizarre situations, like the interaction we're seeing between |
Based on @bcoe's point, @SamNelson I think you should just re-order the plugins. I believe @hzoo started a thread about figuring out how to better approach the babel plugin order problem, but I don't know where that is.
@SamNelson please feel free to reopen this discussion if you're still bumping into issues 👍 we've rolled out a few changes to nyc/istanbul-lib-instrument that I think should solve your problem. |
This should fix issue #39