-
Notifications
You must be signed in to change notification settings - Fork 91
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
process.exit breaks coverage #20
Comments
This is due to the way The deep cause for this behavior is that there is a mismatch between the c8 architecture and the v8 debugger. In In practice, this is not an issue when using coverage for tests because an abrupt exit usually means that there is a deeper issue with your tests. A good solution would be to be allow a spawn-wrapped process to use Edit: I posted a message on V8-users, not sure if it's the right place. |
I think that this issue depends on: istanbuljs/spawn-wrap#47. If you were able to set the args dynamically, you maintain process isolation: Edit: I submitted a rough sketch for an event-based spawn-wrap API that would solve the issue, see linked issue. |
@laggingreflex this should now be fixed with the version on We should add a test for this, so that we can catch any regressions. |
Yep, it works now. |
If you have
process.exit
in a file, it doesn't show any coverage.Repro is simple:
index.js
// process.exit() // uncomment me
Run
c8 node index.js
Without
process.exit()
With
process.exit()
The text was updated successfully, but these errors were encountered: