# Testing signals — facebook/react

> Canonical page: https://codevetter.com/unpack/react/testing-signals

# Testing signals — facebook/react

Scanned commit 59aff3e18cb5b3a336c280bbfa57ec37999511b9 (2026-09-18). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Jest 30 is the runtime test framework, with 544 test files under `packages/**/__tests__`, and it is deliberately unusable directly — `package.json`'s `testRegex` points at `dont-run-jest-directly.js`, forcing everything through `scripts/jest/jest-cli.js`. That CLI selects one of six configs (source, source-www, source-xplat, source-persistent, build, build-devtools) and injects `__DEV__`, `__EXPERIMENTAL__` and `__VARIANT__` globals; individual tests opt in/out of behaviour with `// @gate <flag>` pragmas resolved by `scripts/jest/TestFlags.js`. The compiler uses a different harness entirely: `yarn snap` over ~1,543 fixture files with `.expect.md` snapshots, plus Playwright e2e for the playground and the flight fixture. CI runs the runtime suite as an 18-config × 5-shard matrix; the Rust port has its own workflow gating on `cargo check`, `cargo build`, two shell test scripts and `yarn snap --rust`.
- Jest is pinned at `^30.4.1` (`jest`, `jest-cli`, `jest-environment-jsdom`, `babel-jest`) with `jest-silent-reporter` and `jest-snapshot-serializer-raw` for output control. — [package.json#L86-L95](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/package.json#L86-L95)
- There are 544 test files under `packages/**/__tests__/**/*.js`, spread across the runtime, DevTools shared, scheduler and shared packages. — [packages/react-reconciler/src/__tests__](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/react-reconciler/src/__tests__) [packages/react-dom/src/__tests__](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/react-dom/src/__tests__) [packages/scheduler/src/__tests__](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/scheduler/src/__tests__)
- `scripts/jest/jest-cli.js` is the only supported entry: it exposes `--project {default,devtools}`, `--releaseChannel {experimental,stable,www-classic,www-modern,xplat}`, `--env`, `--prod`/`--dev`, `--variant`, `--build`, `--persistent`, `--ci`, `--reactVersion` and `--sourceMaps`, then spawns Jest with the matching config file. — [scripts/jest/jest-cli.js#L10-L120](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/scripts/jest/jest-cli.js#L10-L120)
- Six Jest configs cover the test surfaces: `config.source.js`, `config.source-www.js`, `config.source-xplat.js`, `config.source-persistent.js`, `config.build.js` and `config.build-devtools.js` — so the same specs are exercised against source and against built bundles. — [scripts/jest/config.source.js](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/scripts/jest/config.source.js) [scripts/jest/config.build.js](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/scripts/jest/config.build.js) [scripts/jest/config.build-devtools.js](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/scripts/jest/config.build-devtools.js) [scripts/jest/jest-cli.js#L10-L18](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/scripts/jest/jest-cli.js#L10-L18)
- `@gate` pragmas let a test declare its preconditions; `scripts/jest/TestFlags.js` resolves them against `shared/ReactFeatureFlags` plus environment flags `__DEV__`, `build`, `experimental`, `stable`, `variant`, `persistent`, and the deliberate escape hatches `FIXME: false` / `TODO: false` for known-broken tests. — [scripts/jest/TestFlags.js#L1-L60](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/scripts/jest/TestFlags.js#L1-L60)
- `scripts/jest/setupHostConfigs.js` rewires module resolution so each test file resolves `react-reconciler/src/ReactFiberConfig` to the right renderer's host config, iterating over `inlinedHostConfigs` — without it every reconciler test would hit the throwing shim. — [scripts/jest/setupHostConfigs.js#L1-L220](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/scripts/jest/setupHostConfigs.js#L1-L220) [packages/react-reconciler/src/ReactFiberConfig.js#L10-L22](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/react-reconciler/src/ReactFiberConfig.js#L10-L22)
- `packages/internal-test-utils` supplies the shared test vocabulary — `internalAct.js`, `ReactInternalTestUtils.js`, `consoleMock.js`, `shouldIgnoreConsoleError.js`/`shouldIgnoreConsoleWarn.js`, and `simulateBrowserEventDispatch.js` — and is itself tested. — [packages/internal-test-utils/internalAct.js](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/internal-test-utils/internalAct.js) [packages/internal-test-utils/ReactInternalTestUtils.js](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/internal-test-utils/ReactInternalTestUtils.js) [packages/internal-test-utils/consoleMock.js](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/packages/internal-test-utils/consoleMock.js)
- The runtime CI matrix in `runtime_build_and_test.yml` runs 18 parameter sets (stable/experimental/www-classic/www-modern/xplat × development/production × variant true/false, plus two persistent configs) crossed with 5 shards, i.e. 90 parallel `yarn test` jobs. — [.github/workflows/runtime_build_and_test.yml#L217-L272](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/.github/workflows/runtime_build_and_test.yml#L217-L272)
- CI also gates on non-test checks as separate jobs: `flow` (sharded by discovered inline configs), `check_generated_fizz_runtime`, `flags`, and `test-linter` for `eslint-plugin-react-hooks`. — [.github/workflows/runtime_build_and_test.yml#L118-L215](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/.github/workflows/runtime_build_and_test.yml#L118-L215) [.github/workflows/runtime_build_and_test.yml#L276-L285](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/.github/workflows/runtime_build_and_test.yml#L276-L285)
- There is a dedicated fuzz workflow (`runtime_fuzz_tests.yml`) separate from the main suite, so fuzzing is not part of the per-PR signal. — [.github/workflows/runtime_fuzz_tests.yml#L1-L35](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/.github/workflows/runtime_fuzz_tests.yml#L1-L35)
- The compiler's test corpus is fixture-driven: ~1,543 `.js` fixtures under `babel-plugin-react-compiler/src/__tests__/fixtures`, each paired with a `.expect.md`, run via `yarn snap` (`-p <pattern>`, `-d` debug, `-u` update) as documented in `compiler/CLAUDE.md`. — [compiler/CLAUDE.md](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/CLAUDE.md) [compiler/packages/snap](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/packages/snap)
- Fixture naming encodes expected failure modes: `error.todo-*.js` means an unsupported feature that correctly bails with a Todo error, `error.bug-*.js` means a known bug producing the wrong error — so some fixtures are assertions about known gaps, not passing behaviour. — [compiler/CLAUDE.md](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/CLAUDE.md)
- The Rust port has its own CI gate: `compiler_rust.yml` runs `cargo check`, `cargo build`, `bash scripts/test-babel-ast.sh`, `bash scripts/test-rust-port.sh`, then builds `snap` and runs `yarn snap --rust` — i.e. the Rust implementation is validated against the same fixture snapshots as the TS one. — [.github/workflows/compiler_rust.yml#L24-L68](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/.github/workflows/compiler_rust.yml#L24-L68)
- Only 14 TypeScript unit-test files exist across the whole `compiler/` tree, versus 1,543 fixtures — the compiler's coverage is almost entirely end-to-end snapshot, with very little unit-level testing of individual passes. (inferred) — [compiler/packages/babel-plugin-react-compiler/src/__tests__](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/packages/babel-plugin-react-compiler/src/__tests__) [compiler/packages/snap](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/packages/snap)
- Browser-level e2e exists in exactly two places: `compiler/apps/playground/__tests__/e2e/page.spec.ts` (Playwright, `--workers=4`) and `fixtures/flight/__tests__/__e2e__/smoke.test.js`; the 25 other directories under `fixtures/` are manual-testing apps with no automated assertions. — [compiler/apps/playground/playwright.config.js](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/compiler/apps/playground/playwright.config.js) [fixtures/flight/playwright.config.js](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/fixtures/flight/playwright.config.js) [fixtures/dom/package.json](https://github.com/facebook/react/blob/59aff3e18cb5b3a336c280bbfa57ec37999511b9/fixtures/dom/package.json)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
