# Testing signals — react/react-native

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

# Testing signals — react/react-native

Scanned commit b7c0e4986a0242cdd47afd002f3e712e80914c3c (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Two JS test systems: Jest 29 unit tests in __tests__/*-test.js (custom preprocessor + haste resolver that strips `exports`, ios/android platforms, fake timers globally) and Fantom *-itest.js integration tests that run JS on Hermes against the real C++ Fabric/mounting stack with a mock host platform — Fantom files must live under packages/react-native. Native testing: Gradle test task for ReactAndroid, scripts/objc-test.sh + RNTesterUnitTests/RCTTest for iOS. CI in test-all.yml gates on lint, test_js, build_js_types, Fantom (with two retry rounds), Android/iOS builds, helloworld e2e, RNTester e2e and Maestro cloud runs.
- Jest config: testRegex '/__tests__/.*-test(\.fb)?\.js$' (the .fb suffix runs Meta-internal tests), haste platforms ['ios','android'] default ios, fakeTimers enabled globally (modern), testEnvironment node, coverage collected from packages/react-native/Libraries/**/*.js and src/**/*.js. — [jest.config.js](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/jest.config.js)
- Jest resolution diverges deliberately from Metro: a custom resolver (packages/jest-preset/jest/resolver.js) strips package.json `exports`, so moduleNameMapper aliases map 'react-native/setup-env', 'react-native/react-private-interface' and 'react-native/unstable-internals-do-not-use' to their src/ files; all sources transform through jest/preprocessor.js. — [jest.config.js#L24-38](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/jest.config.js#L24-L38) [packages/jest-preset/jest/resolver.js](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/packages/jest-preset/jest/resolver.js) [jest/preprocessor.js](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/jest/preprocessor.js)
- Roughly 234 *-test.js files exist under __tests__ dirs (find count) — concentrated in packages/react-native/Libraries and src/private plus per-package suites (community-cli-plugin, dev-middleware, codegen generators/parsers __tests__). — [jest.config.js#L44-52](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/jest.config.js#L44-L52) [packages/react-native-codegen/src/generators/__tests__](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/packages/react-native-codegen/src/generators/__tests__) [packages/dev-middleware/src/__tests__](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/packages/dev-middleware/src/__tests__)
- Fantom (~202 *-itest.js files) is the integration/benchmark runner: tests execute on Hermes with the real C++ Fabric renderer, TurboModules and bridgeless runtime against a mock host platform; API = Fantom.createRoot/runTask/scrollTo/installTimerMock on a deterministic virtual clock; docblock pragmas @fantom_flags, @fantom_mode, @fantom_native_opt, @fantom_js_opt, @fantom_js_bytecode generate test-matrix variants including wildcard '*'. — [private/react-native-fantom/__docs__/README.md#L17-60](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/private/react-native-fantom/__docs__/README.md#L17-L60) [private/react-native-fantom/__docs__/README.md#L284-351](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/private/react-native-fantom/__docs__/README.md#L284-L351) [private/react-native-fantom/src/index.js](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/private/react-native-fantom/src/index.js) [scripts/fantom.sh](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/scripts/fantom.sh)
- Fantom asserts real layout: examples show root.getRenderedOutput({includeLayoutMetrics:true}).toJSX() producing <rn-view layoutMetrics-frame=.../> and element.getBoundingClientRect() returning Yoga-computed metrics — capabilities Jest can't provide; mounting instructions are inspectable via root.takeMountingManagerLogs(). — [private/react-native-fantom/__docs__/README.md#L31-50](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/private/react-native-fantom/__docs__/README.md#L31-L50) [private/react-native-fantom/__docs__/README.md#L224-274](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/private/react-native-fantom/__docs__/README.md#L224-L274) [packages/react-native/Libraries/Components/View/__tests__/View-itest.js](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/packages/react-native/Libraries/Components/View/__tests__/View-itest.js)
- CI Fantom path: test-all.yml job build_fantom_runner (8-core-ubuntu container reactnativecommunity/react-native-android) then run_fantom_tests uses ./.github/workflows/fantom-tests.yml with two automatic retry rounds (run_fantom_tests_retry_1/2, second round sets fail-on-error: true). — [.github/workflows/test-all.yml#L295-336](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/.github/workflows/test-all.yml#L295-L336) [.github/workflows/fantom-tests.yml](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/.github/workflows/fantom-tests.yml) [.github/actions/build-fantom-runner](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/.github/actions/build-fantom-runner)
- E2E coverage: e2e-android-rntester.yml / e2e-ios-rntester.yml / e2e-*-templateapp.yml run RNTester and template apps on emulators/simulators; test_maestro_cloud_{android,ios} push rntester release builds to Maestro Cloud on main pushes and same-repo PRs; helloworld e2e jobs (test_android_helloworld, test_ios_helloworld) validate the template path. — [.github/workflows/test-all.yml#L364-407](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/.github/workflows/test-all.yml#L364-L407) [.github/workflows/test-all.yml#L445-548](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/.github/workflows/test-all.yml#L445-L548) [.github/workflows/e2e-android-rntester.yml](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/.github/workflows/e2e-android-rntester.yml) [.github/workflows/maestro-cloud-rntester.yml](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/.github/workflows/maestro-cloud-rntester.yml)
- Native unit tests: `yarn test-android` runs ./gradlew :packages:react-native:ReactAndroid:test (JUnit/Robolectric under ReactAndroid/src/test); `yarn test-ios` runs scripts/objc-test.sh against packages/rn-tester's RNTesterUnitTests and RCTTest infrastructure. — [package.json#L39-43](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/package.json#L39-L43) [scripts/objc-test.sh](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/scripts/objc-test.sh) [packages/rn-tester/RNTesterUnitTests](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/packages/rn-tester/RNTesterUnitTests) [packages/rn-tester/RCTTest](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/packages/rn-tester/RCTTest)
- Type/API regression gates: `yarn flow-check` (flow full-check, flow-bin 0.332), `yarn test-generated-typescript` (tsc -p __typetests__/tsconfig.json), js-api-diff job via scripts/js-api/diff-api-snapshot (workflow api-changes.yml), and validate-cxx-api-snapshots.yml for the C++ API snapshots. — [package.json#L15-16](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/package.json#L15-L16) [package.json#L44-45](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/package.json#L44-L45) [.github/workflows/api-changes.yml](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/.github/workflows/api-changes.yml) [.github/workflows/validate-cxx-api-snapshots.yml](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/.github/workflows/validate-cxx-api-snapshots.yml) [scripts/cxx-api/api-snapshots](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/scripts/cxx-api/api-snapshots)
- Lint/format gates: `yarn lint` = eslint --max-warnings 0; `yarn format-check` fans out to prettier (js/md/yaml), clang-format (cpp), format-kotlin/format-java/format-python/format-swift scripts, each with pinned toolchain packages; shellcheck runs via .github/workflow-scripts/analyze_scripts.sh; markdownlint via lint-markdown. — [package.json#L17-36](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/package.json#L17-L36) [scripts/clang-format.js](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/scripts/clang-format.js) [scripts/format-kotlin.js](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/scripts/format-kotlin.js) [scripts/format-swift.js](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/scripts/format-swift.js)
- Uncovered/soft spots: testPathIgnorePatterns excludes sdks/hermes and Libraries/Renderer implementations from Jest; Fantom is limited to packages/react-native internals (no app-level testing); C++ sampling profiler (FANTOM_PROFILE_CPP) and JS/C++ debugging (FANTOM_DEBUG_JS/CPP) only work on Meta infrastructure. — [jest.config.js#L45-52](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/jest.config.js#L45-L52) [private/react-native-fantom/__docs__/README.md#L15-16](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/private/react-native-fantom/__docs__/README.md#L15-L16) [private/react-native-fantom/__docs__/README.md#L369-396](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/private/react-native-fantom/__docs__/README.md#L369-L396) [private/react-native-fantom/__docs__/README.md#L479-493](https://github.com/react/react-native/blob/b7c0e4986a0242cdd47afd002f3e712e80914c3c/private/react-native-fantom/__docs__/README.md#L479-L493)

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)
