Skip to content
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

Code added by coverage reporting breaks tests that call .toString() on a function #721

Open
traverse opened this issue May 2, 2023 · 0 comments

Comments

@traverse
Copy link

traverse commented May 2, 2023

Hello, I'm running into some issues trying to generate a coverage report with Jest/Istanbul.

The issue I'm running into is with code that calls .toString() on a function. When running Jest with coverage some code gets added to record the coverage and that breaks the .toString() output. I believe that code is added by Istanbul. If that isn't the case let me know and I'll close this issue and open one with Jest instead.

You can find a reproduction in this sandbox https://codesandbox.io/p/sandbox/beautiful-noyce-vqqv0s?file=%2Fsrc%2Findex.ts.

This is probably not a very common use case since I didn't really find anything in the existing issues.

Edit: Didn't really add a question the first time around so here goes. Is there a way I can solve this issue easily or maybe work around it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant