Home / File/ hello.e2e.js — react Source File

hello.e2e.js — react Source File

Architecture documentation for hello.e2e.js, a javascript file in the react codebase. 5 imports, 0 dependents.

File javascript TestingUtilities E2E 5 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  e9248ace_b139_9678_a79d_b7d2cb6929a0["hello.e2e.js"]
  5a08878b_7e8d_9201_126f_b2be03bccb80["expectLogs.js"]
  e9248ace_b139_9678_a79d_b7d2cb6929a0 --> 5a08878b_7e8d_9201_126f_b2be03bccb80
  9b5c28a1_7004_c572_dd53_c78918c8eb26["expectLogsAndClear"]
  e9248ace_b139_9678_a79d_b7d2cb6929a0 --> 9b5c28a1_7004_c572_dd53_c78918c8eb26
  ce4848f8_46e9_ec40_9ee1_bb0abaf07e5b["log"]
  e9248ace_b139_9678_a79d_b7d2cb6929a0 --> ce4848f8_46e9_ec40_9ee1_bb0abaf07e5b
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  e9248ace_b139_9678_a79d_b7d2cb6929a0 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  9adf9051_2ce4_6a22_5a47_ad6ee61b1f13["react"]
  e9248ace_b139_9678_a79d_b7d2cb6929a0 --> 9adf9051_2ce4_6a22_5a47_ad6ee61b1f13
  style e9248ace_b139_9678_a79d_b7d2cb6929a0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

import * as React from 'react';
import {render} from '@testing-library/react';
import {expectLogsAndClear, log} from './expectLogs';

function Hello({name}) {
  const items = [1, 2, 3].map(item => {
    log(`recomputing ${item}`);
    return <div key={item}>Item {item}</div>;
  });
  return (
    <div>
      Hello<b>{name}</b>
      {items}
    </div>
  );
}

test('hello', () => {
  const {asFragment, rerender} = render(<Hello name="World" />);

  expect(asFragment()).toMatchInlineSnapshot(`
    <DocumentFragment>
      <div>
        Hello
        <b>
          World
        </b>
        <div>
          Item 1
        </div>
        <div>
          Item 2
        </div>
        <div>
          Item 3
        </div>
      </div>
    </DocumentFragment>
  `);

  expectLogsAndClear(['recomputing 1', 'recomputing 2', 'recomputing 3']);

  rerender(<Hello name="Universe" />);

  expect(asFragment()).toMatchInlineSnapshot(`
    <DocumentFragment>
      <div>
        Hello
        <b>
          Universe
        </b>
        <div>
          Item 1
        </div>
        <div>
          Item 2
        </div>
        <div>
          Item 3
        </div>
      </div>
    </DocumentFragment>
  `);

  expectLogsAndClear(
    __FORGET__ ? [] : ['recomputing 1', 'recomputing 2', 'recomputing 3']
  );
});

Subdomains

Functions

Dependencies

Frequently Asked Questions

What does hello.e2e.js do?
hello.e2e.js is a source file in the react codebase, written in javascript. It belongs to the TestingUtilities domain, E2E subdomain.
What functions are defined in hello.e2e.js?
hello.e2e.js defines 1 function(s): Hello.
What does hello.e2e.js depend on?
hello.e2e.js imports 5 module(s): expectLogs.js, expectLogsAndClear, log, react, react.
Where is hello.e2e.js in the architecture?
hello.e2e.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/e2e/hello.e2e.js (domain: TestingUtilities, subdomain: E2E, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/e2e).

Analyze Your Own Codebase

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

Try Supermodel Free