Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(function () {
sandbox.stub(PortFinder, 'getPort').callsFake(function (cb) { // eslint-disable-line promise/prefer-await-to-callbacks
return cb(null, 4444); // eslint-disable-line promise/prefer-await-to-callbacks
});
driver = new AndroidDriver();
driver.adb = sandbox.stub();
driver.adb.curDeviceId = 'device_id';
driver.adb.getAdbServerPort = sandbox.stub().returns(5555);
sandbox.stub(Chromedriver.prototype, 'restart');
sandbox.stub(Chromedriver.prototype, 'start');
sandbox.stub(Chromedriver.prototype.proxyReq, 'bind').returns('proxy');
stubbedChromedriver = sinon.stub();
stubbedChromedriver.proxyReq = sinon.stub();
stubbedChromedriver.proxyReq.bind = sinon.stub();
stubbedChromedriver.restart = sinon.stub();
stubbedChromedriver.stop = sandbox.stub().throws();
stubbedChromedriver.removeAllListeners = sandbox.stub();
});
afterEach(function () {
beforeEach(function () {
sandbox.stub(PortFinder, 'getPort').callsFake(function (cb) { // eslint-disable-line promise/prefer-await-to-callbacks
return cb(null, 4444); // eslint-disable-line promise/prefer-await-to-callbacks
});
driver = new AndroidDriver();
driver.adb = sandbox.stub();
driver.adb.curDeviceId = 'device_id';
driver.adb.getAdbServerPort = sandbox.stub().returns(5555);
sandbox.stub(Chromedriver.prototype, 'restart');
sandbox.stub(Chromedriver.prototype, 'start');
sandbox.stub(Chromedriver.prototype.proxyReq, 'bind').returns('proxy');
stubbedChromedriver = sinon.stub();
stubbedChromedriver.proxyReq = sinon.stub();
stubbedChromedriver.proxyReq.bind = sinon.stub();
stubbedChromedriver.restart = sinon.stub();
stubbedChromedriver.stop = sandbox.stub().throws();
stubbedChromedriver.removeAllListeners = sandbox.stub();
});
afterEach(function () {