-
Notifications
You must be signed in to change notification settings - Fork 63
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
Fix exit code #60
Fix exit code #60
Conversation
If we destroy the only window, Electron seems to quit with an exit code of 0, so mocha’s success/failure won’t be communicated properly. We don’t really need to worry about destroying it anyways, since we’re about to exit.
This seems reasonable. @inukshuk what are your thoughts? |
Huh, looks like the window destruction was just added recently: #56. I guess I'll need to rethink this. |
Hrmph. I'm not sure I can make this and #56 play together nicely. But I'd argue that this is more important, since test reporting is currently broken for CI use cases. |
Alright, so this works. But note that as of #56, we're no longer cleaning up |
…actually fail. jprichardson/electron-mocha#60 is the real fix, but in the mean time we can keep moving.
I think @joshaber is spot on here. Reverting #56 would take care of the bigger issue for now, though I'm curious as to why clean up is being skipped at all. I haven't looked at it yet, but the first thought I had was that Electron just exists cleanly when all windows have been closed (I assume) so perhaps we'd just have to handle the all windows closed event and exit from there (though clean up may have to be a sync function not sure)? I'll take a look at it later today! |
Calling app.exit() instead of process.exist() should force close all open windows therefore making #56 superfluous. As discussed in #60 closing all windows lead to Electron shutting down with exit code 0 thus breaking CI tests etc. This could be worked around by listening for the all-windows-closed event, but I think this is the better solution.
I think that was it: if I just listen for |
LGTM |
Awesome, thanks @inukshuk! |
If we destroy the only window, Electron seems to quit with an exit code of 0, so mocha’s success/failure won’t be communicated properly.
We don’t really need to worry about destroying it anyways, since we’re about to exit.