Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.create = function(config, emitter) {
const calibrator = new Calibrator();
const BrowserManager = {
create: (id) => Browser.create(config.forBrowser(id)),
start: (browser) => browser.launch(calibrator),
onStart: (browser) => emitter.emitAndWait(Events.START_BROWSER, browser),
onQuit: (browser) => emitter.emitAndWait(Events.STOP_BROWSER, browser),
quit: (browser) => browser.quit()
};
const configAdapter = {
forBrowser: (id) => {
const browserConfig = config.forBrowser(id);
return {
parallelLimit: browserConfig.sessionsPerBrowser,
constructor(config, emitter) {
this._config = config;
this._emitter = emitter;
this._browsers = {};
this._calibrator = new Calibrator();
}