Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(resolve => {
if (this.karmaEventListener.isServerLoaded) {
const stopper = require("karma").stopper;
stopper.stop({ port: 9876 }, (exitCode: number) => {
this.logger.info(`Karma exited succesfully`);
resolve();
this.karmaEventListener.stopListeningToKarma();
});
}
});
}
return new Promise(resolve => {
const stopper = require("karma").stopper;
stopper.stop({ port: 9876 }, (exitCode: any) => {
resolve();
});
});
}
public stop(): void {
if (this.karmaEventListener.isServerLoaded) {
const stopper = require("karma").stopper;
stopper.stop({ port: 9876 }, (exitCode: number) => {
this.logger.info(`Karma exited succesfully`);
});
this.karmaEventListener.stopListeningToKarma();
}
}
process.once('exit', () => stopper.stop({}));
process.once('SIGINT', () => process.exit());