tooling/util/server.js
async function start() {
  if (child) {
    await stop();
  }

  return new Promise((resolve) => {
    const serverPath = path.resolve(process.cwd(), 'packages/node_modules/@webex/test-helper-server');

    child = spawn(process.argv[0], [serverPath], {
      env: process.env,
      stdio: ['ignore', 'pipe', process.stderr]
    });

    child.stdout.on('data', (data) => {
      const message = `${data}`;
      const pattern = /.+/gi;

      if (message.match(pattern)) {
        resolve();
      }
    });

    process.on('exit', stop);
  });
}
async function start() {
  if (child) {
    await stop();
  }

  return new Promise((resolve) => {
    const serverPath = path.resolve(process.cwd(), 'packages/node_modules/@webex/test-helper-server');

    child = spawn(process.argv[0], [serverPath], {
      env: process.env,
      stdio: ['ignore', 'pipe', process.stderr]
    });

    child.stdout.on('data', (data) => {
      const message = `${data}`;
      const pattern = /.+/gi;

      if (message.match(pattern)) {
        resolve();
      }
    });

    process.on('exit', stop);
  });
}
async function start ( ) { if ( child ) { await stop ( ) ; } return new Promise ( ( resolve ) => { const serverPath = path . resolve ( process . cwd ( ) , 'packages/node_modules/@webex/test-helper-server' ) ; child = spawn ( process . argv [ 0 ] , [ serverPath ] , { env : process . env , stdio : [ 'ignore' , 'pipe' , process . stderr ] } ) ; child . stdout . on ( 'data' , ( data ) => { const message = ` ${ data } ` ; const pattern = / .+ / gi ; if ( message . match ( pattern ) ) { resolve ( ) ; } } ) ; process . on ( 'exit' , stop ) ; } ) ; }
Starts the test server
@returns {Promise}
Starts the test server