-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Bug] Functions declared after an uncovered return (hoisted) are both uncovered and covered #38
Comments
Actually for an easier repro, just clone microsoft/TypeScript#58850 and do Hopefully this isn't inherent to v8 profiling in general :(( |
It seems like this problem occurs when there is a |
This is super common code in our codebase as we don't use classes, but instead return plain objects of closures for performance. |
@jakebailey Could you please try monocart-coverage-reports@2.8.4 |
Seems like it's working! Thank you! |
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
npx c8 --experimental-monocart --reporter=v8 npm test -- --no-lint
npx serve coverage
Expected behavior
A clear and concise description of what you expected to happen.
Code for hoisted but called functions should be marked as covered.
Errors or Screenshots
Any captured error messages, or add screenshots to help explain your problem.
This code is marked as uncovered in red, but at the same time has the little green boxes showing that it really did execute.
Probably, this has something to do with how these functions are declared after the return but the return is never reached.
Make a minimal reproduction
Sorry, I don't know if I can make a small reproducer; I tried writing similar code like:
But it didn't exhibit the same problem.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: