-
Notifications
You must be signed in to change notification settings - Fork 308
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
Snapshot tests fail with --coverage due to Istanbul instrumentation. #85
Comments
Uh oh. maybe we should remove the |
I'm a bit new to Angular, but it seems like it's something that you would want, because then the function that you've passed your handler to ends up in the snapshot. I am testing that the functionality works in a separate unit test, but I think there might be some value in "testing" that you've passed the correct props to the correct components. Again though, very new to Angular so I might be off base there. |
To me For now, I'm cool with accepting a PR which filters out any valid |
Good point about not needing the function implementation, I definitely agree with that (especially since I unit test those anyway). Maybe something like What would be the correct place to implement a filter like that? Seems like |
That's a right place to add this. Something similar was implemented in pretty-format which formats this code inside Jest serializers, so you can check st the implementation there if you like :) |
OK, sounds great, thanks. I'll try and carve out some time in the next week or two to work through this. |
Awesome, thank you ❤️ |
@brianmcallister have tried this? jestjs/jest#1740 (comment) |
Unfortunately, it looks like the betas aren't working at all (at least for me), instead, they just throw errors on every test. I did dig into this a bit, and this looks like an issue with I don't think it makes too much sense to attempt to patch I'll keep trying the |
When the next beta is up (something above |
Same issue here with [email protected] and [email protected] (and [email protected]):
"Resolved" by increasing the length of the parameter of our function to |
Please try with 7.1.1, the preset now has new serializers to strip out some unnecessary things from snapshot. Feel free to report if you encounter new issues. |
Not 100% sure if this is an issue with this project, but it appears as though when I run Jest with
--coverage
, Istanbul instrumentation ends up in the compiled code, which fails my snapshot tests. Here's a look at the Jest output:I found this issue in the Jest repository, and it seems related, though the person reporting the issue was using a different set of libraries, and it looks like he was testing a React application.
Let me know if there's more information I can provide.
The text was updated successfully, but these errors were encountered: