Home / Function/ runTestShell() — react Function Reference

runTestShell() — react Function Reference

Architecture documentation for the runTestShell() function in run_devtools_e2e_tests.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  42885c2a_96a4_eff2_6f22_422526901e2f["runTestShell()"]
  78a11329_415e_c941_dd54_1e297b28e203["run_devtools_e2e_tests.js"]
  42885c2a_96a4_eff2_6f22_422526901e2f -->|defined in| 78a11329_415e_c941_dd54_1e297b28e203
  19d9ee7b_a1d8_275c_f5ea_2c281b50fe99["buildInlinePackage()"]
  19d9ee7b_a1d8_275c_f5ea_2c281b50fe99 -->|calls| 42885c2a_96a4_eff2_6f22_422526901e2f
  28aa116e_e9ec_a7a6_5770_77a1c33f5403["logError()"]
  42885c2a_96a4_eff2_6f22_422526901e2f -->|calls| 28aa116e_e9ec_a7a6_5770_77a1c33f5403
  3adf197f_a59b_1c37_d94a_1af13936d213["exitWithCode()"]
  42885c2a_96a4_eff2_6f22_422526901e2f -->|calls| 3adf197f_a59b_1c37_d94a_1af13936d213
  35615c69_e215_2b70_48c1_28968c6ef1e3["logBright()"]
  42885c2a_96a4_eff2_6f22_422526901e2f -->|calls| 35615c69_e215_2b70_48c1_28968c6ef1e3
  b2823440_ebe2_7146_7acd_d71cb37e21ea["runEndToEndTests()"]
  42885c2a_96a4_eff2_6f22_422526901e2f -->|calls| b2823440_ebe2_7146_7acd_d71cb37e21ea
  b809d57d_5f1f_3a96_a862_467a299e2033["logDim()"]
  42885c2a_96a4_eff2_6f22_422526901e2f -->|calls| b809d57d_5f1f_3a96_a862_467a299e2033
  style 42885c2a_96a4_eff2_6f22_422526901e2f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/ci/run_devtools_e2e_tests.js lines 77–123

function runTestShell() {
  const timeoutID = setTimeout(() => {
    // Assume the test shell server failed to start.
    logError('Testing shell server failed to start');
    exitWithCode(1);
  }, 60 * 1000);

  logBright('Starting testing shell server');

  if (!reactVersion) {
    serverProcess = spawn('yarn', ['start'], {cwd: shellPackagePath});
  } else {
    serverProcess = spawn('yarn', ['start'], {
      cwd: shellPackagePath,
      env: {...process.env, REACT_VERSION: reactVersion},
    });
  }

  serverProcess.stdout.on('data', data => {
    if (`${data}`.includes(SUCCESSFUL_COMPILATION_MESSAGE)) {
      logBright('Testing shell server running');

      clearTimeout(timeoutID);

      runEndToEndTests();
    }
  });

  serverProcess.stderr.on('data', data => {
    if (`${data}`.includes('EADDRINUSE')) {
      // Something is occupying this port;
      // We could kill the process and restart but probably better to prompt the user to do this.

      logError('Free up the port and re-run tests:');
      logBright('  kill -9 $(lsof -ti:8080)');

      exitWithCode(1);
    } else if (`${data}`.includes('ERROR')) {
      logError(`Error:\n${data}`);

      exitWithCode(1);
    } else {
      // Non-fatal stuff like Babel optimization warnings etc.
      logDim(data);
    }
  });
}

Domain

Subdomains

Frequently Asked Questions

What does runTestShell() do?
runTestShell() is a function in the react codebase, defined in scripts/ci/run_devtools_e2e_tests.js.
Where is runTestShell() defined?
runTestShell() is defined in scripts/ci/run_devtools_e2e_tests.js at line 77.
What does runTestShell() call?
runTestShell() calls 5 function(s): exitWithCode, logBright, logDim, logError, runEndToEndTests.
What calls runTestShell()?
runTestShell() is called by 1 function(s): buildInlinePackage.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free