-
Notifications
You must be signed in to change notification settings - Fork 787
Istanbul removes function name in coverage #699
Comments
That instrumented code seems to be missing some essential components: output is never set, the instrumented |
I have this same issue when creating snapshots in Jest with enzyme shallow rendering. When I run with coverage the snapshot renders as this because https://github.com/airbnb/enzyme/blob/master/src/Debug.js#L26 default to Component in the specified case |
@mikewoudenberg Yeah it's super annoying. Using function statements instead of expressions and arrow functions fixes it, but it shouldn't actually matter how you define your component. Unfortunately this particular issue has existed with istanbul for quite some time now.. |
Workaround idea. You could enforce using named function using the func-style eslint plugin.
|
Any update on this issue? |
I've recently encountered this issue and I tried to fix it on the istanbul side. I forked istanbuljs/babel-plugin-istanbul#125 Could you folks let me know what you think about my proposal? |
This:
Becomes this:
It was named
square
, but after coverage it becomes anonymousThe text was updated successfully, but these errors were encountered: