Skip to content

feat: Manual runtime test runs, one library at a time, with Reanimated preload#9929

Open
tjzel wants to merge 1 commit into
@tjzel/split-runtime-testsfrom
@tjzel/manual-runtime-tests
Open

feat: Manual runtime test runs, one library at a time, with Reanimated preload#9929
tjzel wants to merge 1 commit into
@tjzel/split-runtime-testsfrom
@tjzel/manual-runtime-tests

Conversation

@tjzel

@tjzel tjzel commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Note

This PR description was AI-generated.

Stacked on #9928. Part 3 of the runtime-tests spec.

Summary

I made the manual in-app runtime test flow enforce running only one library per app session, and made the Reanimated preload explicit.

  • I added an explicit import 'react-native-reanimated' at the top of the Runtime Tests app-type. This guarantees Reanimated's commit hook installs at app boot — before any React commit — instead of relying on the Reanimated examples registry happening to import it first. Loading Reanimated after the first commit is the known race that crashes the experimental LayoutAnimations commit hook on views mounted before the hook was installed.
  • I added a session-ownership guard to RuntimeTestsRunner: the first library whose tests you run claims the JS session, and the other library's screen then shows a message asking to reload the app instead of the test selector. This is necessary because ReJest's suite registration is module-level (describe runs at require time) and its TestRunner singleton accumulates suites for the whole session — running both libraries in one session would merge the registries and re-run the first library's tests inside the second run. The runner was already one-shot per session ("Reload the app to run the tests again"), so this extends the same semantics across the two screens. The guard only engages when a runnerId prop is passed, so any other RuntimeTestsRunner usage is unaffected.

Test plan

  • yarn type:check:native in apps/common-app passes with zero errors.
  • Manual on simulator: run Worklets tests → navigate to Reanimated tests → the reload message appears (and vice versa after a reload).

@tjzel

tjzel commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator Author

Simulator verification (iPhone 17 Pro, iOS 26.5, Debug, Metro bundle from this branch stack):

  • Drawer shows the new Runtime Tests app-type; home screen opens Reanimated/Worklets runners.
  • Worklets tests: 5 suites listed (bundle mode core correctly deselected with bundle mode off) — 1350 passed, 0 failed, 1 skipped in ~96 s.
  • Session guard: after the Worklets run, the Reanimated screen shows "Worklets tests already ran in this session. Reload the app to run Reanimated tests." as intended.
  • After a JS reload, Reanimated tests: 11 suites listed — 211 passed, 1 failed (Animate 3 components from {margin:-50,top:20} to {margin:40,top:200}, animate=true — animations snapshot test, not among the previously known failures; being tracked for the test-fixes part of the spec).

Comment generated by AI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant