You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 31, 2019. It is now read-only.
I spent some time digging into this issue and this is what I found:
Isparta extends Istanbul's Instrumenter class and overrides the input code with babel generated code, and patches the generated metrics (statementMap, fnMap, branchMap) using the source map generated by Babel, mapping the generated positions back to the original positions in the source code. However, Babel's source map isn't detailed enough to return the precise end position for any expression. For example, it returns a column number of 0 for the end position of expressions that are part of:
a boolean expression, e.g. a || b
a ternary expression, e.g. a ? b : c
When Istanbul's HTML reporter is generating the HTML, it attempts to wrap the skipped branch, e.g. b with a <span>, however the end column is smaller than the starter column, so it fails to insert the closing </span>, causing the "skipped branch" span to include everything until the end of file.
I don't see a way to fix this other than asking Babel to provide source maps with better precision, but I also don't think it's going to be easy.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It seems that can't deal with '||'.
The text was updated successfully, but these errors were encountered: