You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the Karma server is run programmatically, there is no way to request it to stop and be informed of when that has happened:
const karma = require('karma');
const karmaServer = new karma.Server({ singleRun: false, configFile: __dirname + '/karma.conf.js' });
karmaServer.start();
// How to stop the server, and be informed when cleanup is finished?
// karma.stop(() => console.log('server exited gracefully'));
To reproduce, follow these steps:
git clone https://github.com/filipesilva/karma-exit-gracefully
cd karma-exit-gracefully
npm install
npm test
Having a way to gracefully stop Karma is useful when the Karma run is part of more complex orchestration, like in gulp or @angular/cli.
There is a way to stop the server by calling karma stop, but that will kill the process altogether:
When the Karma server is run programmatically, there is no way to request it to stop and be informed of when that has happened:
To reproduce, follow these steps:
Having a way to gracefully stop Karma is useful when the Karma run is part of more complex orchestration, like in
gulp
or@angular/cli
.There is a way to stop the server by calling
karma stop
, but that will kill the process altogether:https://github.com/karma-runner/karma/blob/6742ecfbc9501a454430cbb3b814be28f459cb38/lib/middleware/stopper.js#L11-L13
There's some cleanup logic as well, but it only runs on
--single-run
:https://github.com/karma-runner/karma/blob/6742ecfbc9501a454430cbb3b814be28f459cb38/lib/server.js#L289-L292
Related to karma-runner/karma#2867, ampproject/amphtml#14814
The text was updated successfully, but these errors were encountered: