chore(base-driver): use random port in websockets e2e test
MODIFY
packages/base-driver/test/basedriver/helpers-e2e-specs.js
packages/base-driver/test/basedriver/helpers-e2e-specs.js
@@ -15,6 +15,7 @@ chai.should();
chai.use(chaiAsPromised);
function getFixture (file) {
+ // XXX: __dirname disallowed in native ESM
return path.resolve(__dirname, '..', '..', '..', 'test', 'basedriver', 'fixtures', file);
}

MODIFY
packages/base-driver/test/basedriver/websockets-e2e-specs.js
packages/base-driver/test/basedriver/websockets-e2e-specs.js
@@ -6,6 +6,7 @@ import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import WebSocket from 'ws';
import B from 'bluebird';
+import getPort from 'get-port';
chai.use(chaiAsPromised);
@@ -14,11 +15,12 @@ describe('Websockets (e2e)', function () {
let driver;
const SESSION_ID = 'foo';
const WS_DATA = 'Hello';
- const PORT = 8181;
+ let PORT;
before(async function () {
driver = new FakeDriver();
driver.sessionId = SESSION_ID;
+ PORT = await getPort();
baseServer = await server({
routeConfiguringFunction: routeConfiguringFunction(driver),
port: PORT,

chore(base-driver): use random port in websockets e2e test