Home / Function/ getFixtures() — react Function Reference

getFixtures() — react Function Reference

Architecture documentation for the getFixtures() function in fixture-utils.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  35f5a65c_e6e8_8fa8_f9c0_158316bd8913["getFixtures()"]
  4d76833e_f078_3b83_e453_82ab13e17c43["fixture-utils.ts"]
  35f5a65c_e6e8_8fa8_f9c0_158316bd8913 -->|defined in| 4d76833e_f078_3b83_e453_82ab13e17c43
  6449f3d6_f157_1b29_f37a_a1faad31e9e1["subscribeKeyEvents()"]
  6449f3d6_f157_1b29_f37a_a1faad31e9e1 -->|calls| 35f5a65c_e6e8_8fa8_f9c0_158316bd8913
  8b079862_93aa_0084_8b1a_0473b6ef4307["runFixtures()"]
  8b079862_93aa_0084_8b1a_0473b6ef4307 -->|calls| 35f5a65c_e6e8_8fa8_f9c0_158316bd8913
  c9fc6b7b_b3b4_2404_6749_1f817135b9e4["readInputFixtures()"]
  35f5a65c_e6e8_8fa8_f9c0_158316bd8913 -->|calls| c9fc6b7b_b3b4_2404_6749_1f817135b9e4
  853aca00_d0f5_35b5_4c4d_3954a4f69841["readOutputFixtures()"]
  35f5a65c_e6e8_8fa8_f9c0_158316bd8913 -->|calls| 853aca00_d0f5_35b5_4c4d_3954a4f69841
  style 35f5a65c_e6e8_8fa8_f9c0_158316bd8913 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/snap/src/fixture-utils.ts lines 157–188

export async function getFixtures(
  filter: TestFilter | null,
): Promise<Map<string, TestFixture>> {
  const inputs = await readInputFixtures(FIXTURES_PATH, filter);
  const outputs = await readOutputFixtures(FIXTURES_PATH, filter);

  const fixtures: Map<string, TestFixture> = new Map();
  for (const [partialPath, {value, filepath}] of inputs) {
    const output = outputs.get(partialPath) ?? null;
    fixtures.set(partialPath, {
      fixturePath: partialPath,
      input: value,
      inputPath: filepath,
      snapshot: output,
      snapshotPath: path.join(FIXTURES_PATH, partialPath) + SNAPSHOT_EXTENSION,
    });
  }

  for (const [partialPath, output] of outputs) {
    if (!fixtures.has(partialPath)) {
      fixtures.set(partialPath, {
        fixturePath: partialPath,
        input: null,
        inputPath: 'none',
        snapshot: output,
        snapshotPath:
          path.join(FIXTURES_PATH, partialPath) + SNAPSHOT_EXTENSION,
      });
    }
  }
  return fixtures;
}

Domain

Subdomains

Frequently Asked Questions

What does getFixtures() do?
getFixtures() is a function in the react codebase, defined in compiler/packages/snap/src/fixture-utils.ts.
Where is getFixtures() defined?
getFixtures() is defined in compiler/packages/snap/src/fixture-utils.ts at line 157.
What does getFixtures() call?
getFixtures() calls 2 function(s): readInputFixtures, readOutputFixtures.
What calls getFixtures()?
getFixtures() is called by 2 function(s): runFixtures, subscribeKeyEvents.

Analyze Your Own Codebase

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

Try Supermodel Free