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 learned about how Istanbul measures coverage in a really cool way thanks to my current problem. My current task is to write a javascript function and then return the function as a string. My unit test attempts to eval the string function and fails because of the following error:
ReferenceError: __cov_HnbYpbOoQM4MaLYAY_l6Ig is not defined
When I take a look at the value of my function string, I see this:
Cool huh? Now I understand how instanbul is able to see what code was visited during unit test execution. In the coverage context, I'm sure __cov_HnbYpbOoQM4MaLYAY_l6Ig is defined and works fine. But, in my unit test context, it doesn't exist. :)
Here are a couple of gulp tasks that I think are relevant:
So, I think I need a way to prevent istanbul from adding coverage code to this function. I have tried /* istanbul ignore next */ in various places with no luck (coverage code still present). I would gladly provide my unit test context with a defined __cov_HnbYpbOoQM4MaLYAY_l6Ig but that slug changes each time.
Not sure what to try next. Any help would be appreciated!
The text was updated successfully, but these errors were encountered:
I learned about how Istanbul measures coverage in a really cool way thanks to my current problem. My current task is to write a javascript function and then return the function as a string. My unit test attempts to
eval
the string function and fails because of the following error:When I take a look at the value of my function string, I see this:
Cool huh? Now I understand how instanbul is able to see what code was visited during unit test execution. In the coverage context, I'm sure
__cov_HnbYpbOoQM4MaLYAY_l6Ig
is defined and works fine. But, in my unit test context, it doesn't exist. :)Here are a couple of gulp tasks that I think are relevant:
So, I think I need a way to prevent istanbul from adding coverage code to this function. I have tried
/* istanbul ignore next */
in various places with no luck (coverage code still present). I would gladly provide my unit test context with a defined__cov_HnbYpbOoQM4MaLYAY_l6Ig
but that slug changes each time.Not sure what to try next. Any help would be appreciated!
The text was updated successfully, but these errors were encountered: