Home / File/ run_devtools_e2e_tests.js — react Source File

run_devtools_e2e_tests.js — react Source File

Architecture documentation for run_devtools_e2e_tests.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

#!/usr/bin/env node

'use strict';

const {spawn} = require('child_process');
const {join} = require('path');

const ROOT_PATH = join(__dirname, '..', '..');
const reactVersion = process.argv[2];
const inlinePackagePath = join(ROOT_PATH, 'packages', 'react-devtools-inline');
const shellPackagePath = join(ROOT_PATH, 'packages', 'react-devtools-shell');
const playwrightArtifactsPath = join(ROOT_PATH, 'tmp', 'playwright-artifacts');

const {SUCCESSFUL_COMPILATION_MESSAGE} = require(
  join(shellPackagePath, 'constants.js')
);

let buildProcess = null;
let serverProcess = null;
let testProcess = null;

function format(loggable) {
  return `${loggable}`
    .split('\n')
    .filter(line => {
      return line.trim() !== '';
    })
    .map(line => `  ${line}`)
    .join('\n');
}

function logBright(loggable) {
  console.log(`\x1b[1m${loggable}\x1b[0m`);
}

function logDim(loggable) {
  const formatted = format(loggable, 2);
  if (formatted !== '') {
    console.log(`\x1b[2m${formatted}\x1b[0m`);
  }
}

function logError(loggable) {
  const formatted = format(loggable, 2);
  if (formatted !== '') {
    console.error(`\x1b[31m${formatted}\x1b[0m`);
  }
}

function buildInlinePackage() {
  logBright('Building inline packages');

  buildProcess = spawn('yarn', ['build'], {cwd: inlinePackagePath});
  buildProcess.stdout.on('data', data => {
    logDim(data);
  });
  buildProcess.stderr.on('data', data => {
    if (
      `${data}`.includes('Warning') ||
      // E.g. [BABEL] Note: The code generator has deoptimised the styling of * as it exceeds the max of 500KB.
// ... (141 more lines)

Domain

Subdomains

Frequently Asked Questions

What does run_devtools_e2e_tests.js do?
run_devtools_e2e_tests.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Optimization subdomain.
What functions are defined in run_devtools_e2e_tests.js?
run_devtools_e2e_tests.js defines 8 function(s): buildInlinePackage, exitWithCode, format, logBright, logDim, logError, runEndToEndTests, runTestShell.
Where is run_devtools_e2e_tests.js in the architecture?
run_devtools_e2e_tests.js is located at scripts/ci/run_devtools_e2e_tests.js (domain: BabelCompiler, subdomain: Optimization, directory: scripts/ci).

Analyze Your Own Codebase

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

Try Supermodel Free