How to use the @bazel/protractor/protractor-utils.findFreeTcpPort function in @bazel/protractor

To help you get started, we’ve selected a few @bazel/protractor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github angular / components / src / e2e-app / start-devserver.js View on Github external
async function runBazelServer(workspace, serverPath, timeout) {
  const serverBinary = require.resolve(`${workspace}/${serverPath}`);
  const port = await utils.findFreeTcpPort();

  // Start the Bazel server binary with a random free TCP port.
  const serverProcess = spawn(serverBinary, ['-port', port], {stdio: 'inherit'});

  // In case the process exited with an error, we want to propagate the error.
  serverProcess.on('exit', exitCode => {
    if (exitCode !== 0) {
      throw new Error(`Server exited with error code: ${exitCode}`);
    }
  });

  // Wait for the server to be bound to the given port.
  await utils.waitForServer(port, timeout);

  return port;
}

@bazel/protractor

Run Protractor tests under Bazel

Apache-2.0
Latest version published 1 year ago

Package Health Score

73 / 100
Full package analysis