-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Karma javascript API calls process.exit(1) #3612
Comments
Karma calling As for logging I think it should work when using Karma programatically, or at least I don't see any special handling in the code. I'll do some debugging in the coming days and get back to you. |
Perfect! Pretty crazy that you just added this so recently and it happens to be exactly what I'm looking for. |
Regarding the logging not working. Can you provide a minimal reproduction? Given the below minimal code,
I agree however that it would be good to emit |
If it was an issue, it definitely isn't one now, I think maybe it was just exiting before the logger was being evaluated. Thanks for all your help! |
Hello, I'm working on writing some integration tests for the karma-webpack plugin, and I ran into some trouble while using the karma javascript API.
The first issue is that when you directly call
server.start()
, and there are errors in the passed karma configuration, internally karma will callprocess.exit(1)
forcing the currently running node process to exit.Alongside this, the internal logging that karma uses to report these errors with log4js will by default not print out anything, so my initial experience was my test just exiting without explanation.
My current workaround for this was to pull in log4js and manually set the log level to figure out what was actually being reported and fix my configuration issues.
Would it make sense to add configuration options for setting the log4js level and also to potentially circumvent the
process.exit(1)
and alternatively emit some kind of fatal_error event? If so this is something I could look into adding.Thanks!
EDIT: I worked around this issue by using a forked child_process, but I'll leave this open as I think that these could still be useful changes to implement.
The text was updated successfully, but these errors were encountered: