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 8, 2024. It is now read-only.
I’m using istanbul 1.0.0-alpha 2 with babel 6.5.0 in the same way as sample-mocha-compilers.
I’ve noticed a bug where istanbul reports an uncovered branch which is not visible in the HTML report. After some debugging and looking at the transpiled code from babel I was able to create a minimal reproducible example based on sample-mocha-compilers.
@lo1tuma You can just provide it tests two variants of maybeObj:
maybeObj = undefined
maybeObj = 'string'
then
typeof maybeObj === 'object'
will run both branches hidden at babel replacement of typeof
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I’m using istanbul 1.0.0-alpha 2 with babel 6.5.0 in the same way as
sample-mocha-compilers
.I’ve noticed a bug where istanbul reports an uncovered branch which is not visible in the HTML report. After some debugging and looking at the transpiled code from babel I was able to create a minimal reproducible example based on
sample-mocha-compilers
.The example can be found here: https://github.com/lo1tuma/sample-mocha-compilers/tree/issue-inline-ternary.
babel-plugin-transform-es2015-typeof-symbol
transforms atypeof
expression to a ternary which causes additional branches.For example:
typeof bar === 'object'
will be transpiled to
(typeof bar === 'undefined' ? 'undefined' : _typeof(bar)) === 'object'
It seems like istanbul doesn’t recognise that this code was generated by babel and reports that one of the branches in the ternary isn’t covered.
Here is the screenshot of the HTML report of the example mentioned above:
As you can see the generated code isn’t visible anymore and according to the line-coverage every branch was taken.
The text was updated successfully, but these errors were encountered: