vitest-native 0.13.0 → 0.14.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.md +339 -0
  2. package/README.md +138 -48
  3. package/dist/cli.cjs +70 -5
  4. package/dist/cli.d.cts +2 -3
  5. package/dist/cli.d.mts +2 -3
  6. package/dist/cli.mjs +70 -5
  7. package/dist/{ecosystem-Duw40-mO.mjs → ecosystem-DFbU_MPe.mjs} +389 -18
  8. package/dist/{ecosystem-CEIF_-jq.cjs → ecosystem-DI1AhK_k.cjs} +408 -25
  9. package/dist/errors.d.mts +12 -0
  10. package/dist/helpers.cjs +6 -3
  11. package/dist/helpers.d.cts +8 -9
  12. package/dist/helpers.d.mts +8 -9
  13. package/dist/helpers.mjs +6 -3
  14. package/dist/{index-CPGq6p95.d.cts → index-BxzW2D7K.d.cts} +33 -9
  15. package/dist/{index-CmETArCM.d.mts → index-CEbwa4QU.d.mts} +33 -9
  16. package/dist/index.d.mts +4 -4
  17. package/dist/index.mjs +537 -118
  18. package/dist/jest-compat/aliases.d.mts +5 -0
  19. package/dist/jest-compat/aliases.mjs +65 -0
  20. package/dist/jest-compat/caller.mjs +53 -0
  21. package/dist/jest-compat/setup.mjs +72 -36
  22. package/dist/jest-compat.cjs +1 -3
  23. package/dist/jest-compat.d.cts +4 -5
  24. package/dist/jest-compat.d.mts +4 -5
  25. package/dist/jest-compat.mjs +1 -1
  26. package/dist/matchers.d.cts +9 -9
  27. package/dist/matchers.d.mts +9 -9
  28. package/dist/memory-6EPHrJA1.cjs +144 -0
  29. package/dist/memory-FYbP0_gg.mjs +126 -0
  30. package/dist/native/boundary.mjs +13 -2
  31. package/dist/native/bounded-process.mjs +165 -0
  32. package/dist/native/export-condition-recovery-preload.mjs +5 -0
  33. package/dist/native/export-condition-recovery.mjs +195 -0
  34. package/dist/native/globals.mjs +133 -5
  35. package/dist/native/hooks.mjs +131 -71
  36. package/dist/native/loader.mjs +41 -28
  37. package/dist/native/match.d.mts +3 -0
  38. package/dist/native/match.mjs +38 -2
  39. package/dist/native/metro-profile-compiler.mjs +234 -0
  40. package/dist/native/metro-profile.mjs +115 -0
  41. package/dist/native/module-reset.mjs +111 -6
  42. package/dist/native/ownership.d.mts +105 -0
  43. package/dist/native/ownership.mjs +474 -0
  44. package/dist/native/registry-compiler.mjs +43 -0
  45. package/dist/native/registry-process.mjs +124 -0
  46. package/dist/native/registry.mjs +139 -32
  47. package/dist/native/reset.mjs +305 -135
  48. package/dist/native/resolve.d.mts +20 -3
  49. package/dist/native/resolve.mjs +32 -12
  50. package/dist/native/rntl-hooks.mjs +76 -0
  51. package/dist/native/setup.mjs +81 -32
  52. package/dist/native/state-manifest.d.mts +22 -0
  53. package/dist/native/state-manifest.mjs +136 -0
  54. package/dist/native/transform.mjs +29 -8
  55. package/dist/native/worker.mjs +52 -4
  56. package/dist/pool-B4yesGhI.cjs +121 -0
  57. package/dist/pool-DjpOjOf3.mjs +119 -0
  58. package/dist/{presets-CoNf4ByH.cjs → presets-BYHmi7-W.cjs} +117 -18
  59. package/dist/{presets-DGProTaA.mjs → presets-DC-eM5IA.mjs} +117 -18
  60. package/dist/presets.d.mts +1 -1
  61. package/dist/presets.mjs +1 -1
  62. package/dist/rntl-matchers.d.ts +58 -12
  63. package/dist/serializer.cjs +4 -2
  64. package/dist/serializer.d.cts +3 -4
  65. package/dist/serializer.d.mts +3 -4
  66. package/dist/serializer.mjs +4 -2
  67. package/dist/setup.mjs +61 -50
  68. package/dist/worker-vitest-BGPo0ek6.mjs +49 -0
  69. package/dist/worker-vitest-BfiQB8ND.cjs +62 -0
  70. package/docs/hot-default-design.md +175 -88
  71. package/docs/migrating-from-jest.md +12 -5
  72. package/docs/migrating-from-vitest-react-native.md +4 -4
  73. package/docs/release-readiness.md +39 -13
  74. package/docs/versioning.md +19 -18
  75. package/package.json +42 -31
  76. package/dist/pool-BU-1ecIF.cjs +0 -122
  77. package/dist/pool-Bcxn9a3I.mjs +0 -118
package/CHANGELOG.md CHANGED
@@ -1,5 +1,344 @@
1
1
  # vitest-native
2
2
 
3
+ ## 0.14.0
4
+
5
+ ### Upgrading from 0.13
6
+
7
+ - **The native engine reuses workers by default.** `hotRuntime` now defaults to `'auto'` (it was
8
+ `false`): workers are reused across test files, with React Native, the app and test modules, and
9
+ verified process state reset per file. It keeps Vitest's per-file isolation whenever the run cannot
10
+ be bounded, or when you set a pool or `test.isolate` yourself, in the config or on the command line.
11
+ - **How to tell, and how to opt out.** When it is active, the startup banner names it, as in
12
+ `(platform ios, hot runtime)`. If a test passes on its own but fails alongside others, see
13
+ [troubleshooting](https://danfry1.github.io/vitest-native/guide/troubleshooting#a-test-passes-on-its-own-but-fails-when-run-with-other-files);
14
+ `hotRuntime: false` restores per-file isolation.
15
+ - **Expo path aliases resolve.** In an Expo project on Vite 8, imports through tsconfig `paths` (the
16
+ template's `@/…`) now resolve as Metro resolves them; a `vite-tsconfig-paths` plugin or a hand-written
17
+ alias for them can go.
18
+ - **`hotRuntime: true` is stricter.** Combined with a configured pool, `test.isolate`, or a conflicting
19
+ CLI flag, it now fails at startup with `HOT_RUNTIME_OVERRIDDEN` instead of warning and overriding.
20
+
21
+ ### Minor Changes
22
+
23
+ - 87d8dd0: Use the hot runtime for suites migrated from Jest under `hotRuntime: 'auto'`
24
+
25
+ `'auto'`, the default, no longer keeps per-file isolation for suites set up with
26
+ `jestMockTransform()` or the jest-compat setup. The jest-compat surface — `jest.mock` in
27
+ its hoisted, partial, factory-less and runtime forms, spies on React Native APIs, `console`
28
+ and package exports, fake timers and `jest.setSystemTime`, `jest.setTimeout`, globals,
29
+ `process.env`, snapshot state, React Native Testing Library cleanup, and a project setup
30
+ file's top-level mocks, matchers and globals — now has its own cross-file isolation gate
31
+ under the hot runtime. `hotRuntime: false` keeps
32
+ per-file isolation for a suite that needs it.
33
+
34
+ - d0d968a: Use the hot runtime by default where it can be bounded
35
+
36
+ `hotRuntime` now defaults to `'auto'` under the native engine. A run reuses workers and resets
37
+ React Native's registry, the app/test module graph and the verified process state per file
38
+ whenever the scheduler provides recyclable boundaries (at least two workers within the memory
39
+ plan), no other pool is configured, and the worker and the project resolve the same Vitest
40
+ version; otherwise it keeps Vitest's per-file isolation, as before. Suites set up for Jest
41
+ migration are included (see the separate entry on admitting them).
42
+
43
+ When hot is selected, concurrency follows the hot memory plan, which caps automatic workers at
44
+ four. Set implicitly, `'auto'` is quiet about both its fallbacks and that cap;
45
+ `diagnostics: true`, or setting `hotRuntime: 'auto'` explicitly, reports them.
46
+ `hotRuntime: false` restores per-file isolation unconditionally, and `hotRuntime: true` still
47
+ requires hot mode and fails closed when it cannot be bounded — including on a Vitest version
48
+ mismatch, which `'auto'` treats as a reason to fall back.
49
+
50
+ - 2581950: Add an experimental `metroConfig` option that reads the project's Metro resolution profile
51
+
52
+ `reactNative({ metroConfig: true })` evaluates the project's Metro config (or Expo's defaults)
53
+ in a short-lived, memory-bounded child process and applies its declarative resolution profile:
54
+ source extensions and their order, and asset extensions. Main fields and conditions are
55
+ reported under `diagnostics`. `metroConfig: { configFile }` points at a config outside the
56
+ project root. A custom `resolver.resolveRequest` is code and does not run under Vitest; the
57
+ extensions still apply and one warning names the gap. Default: `false`.
58
+
59
+ ### Patch Changes
60
+
61
+ - bb9cf45: Fix `./App` resolving to `app.json` on macOS and Windows
62
+
63
+ The React Native CLI template ships `App.tsx` and `app.json` side by side, and its own test
64
+ imports `../App`. Metro's extension order tries `.json` before `.tsx`, and macOS and Windows disks
65
+ are case-insensitive, so asking whether `App.json` exists answered yes for `app.json`. The template's
66
+ test then rendered `{ name, displayName }` and failed with "Element type is invalid … got: object",
67
+ while it passes under Jest. Metro resolves from a case-sensitive file map, and Linux CI is
68
+ case-sensitive, which is why neither caught it. Extensionless relative imports now match file
69
+ names exactly, under both engines.
70
+
71
+ - e2fa36e: Resolve tsconfig path aliases in Expo projects, as Expo's Metro does
72
+
73
+ Expo CLI resolves the `paths` in `tsconfig.json` by default, and the SDK 57 template imports its
74
+ own components through `@/…`, so the first component test in a new Expo project failed with
75
+ "Cannot find package '@/components/…'". In an Expo project with a `tsconfig.json`, the plugin now
76
+ turns on Vite 8's `resolve.tsconfigPaths`. An explicit `resolve.tsconfigPaths` and
77
+ `experiments.tsconfigPaths: false` in `app.json` both take precedence. On Vite 6 and 7, which
78
+ cannot resolve tsconfig paths, it warns once with the remedy. Bare React Native projects are
79
+ unchanged, matching their Metro.
80
+
81
+ - d23ecfa: Stop warning about `jest.mock()` in files the project does not own
82
+
83
+ The warning that a file calls `jest.mock()` without `jestMockTransform()` also fired on
84
+ dependencies and on vitest-native's own files: the jest-compat setup, which implements `jest.mock`,
85
+ and the plugin source, which only names it. A project using `vitest-native/jest-compat/setup`
86
+ without the transform was told to fix a file inside `node_modules/vitest-native`. The warning now
87
+ applies only to the project's own files.
88
+
89
+ - d93d80d: Fix Expo packages whose TypeScript source has no type syntax failing to load
90
+
91
+ Expo packages publish their TypeScript source (`expo-modules-core`'s `main` is `src/index.ts`),
92
+ and the native engine compiles it before Node runs it. A file that Node could already parse was
93
+ handed to Node unchanged, which is right for JavaScript but not for TypeScript: Node refuses any
94
+ `.ts` file under `node_modules`, whatever it contains. `expo-modules-core/src/polyfill/index.ts`
95
+ is a bare `// noop`, so a test rendering the Expo SDK 57 template's `Collapsible` (through
96
+ `expo-symbols`) failed with "Stripping types is currently unsupported for files under
97
+ node_modules". TypeScript files are now always compiled.
98
+
99
+ - 7f70965: Fix multi-project runs failing when a native project uses the hot runtime
100
+
101
+ Vitest runs projects that share a `sequence.groupOrder` (0 unless set) as one group, and stops
102
+ the run when they resolve to different `maxWorkers` ("Projects … have different 'maxWorkers'
103
+ but same 'sequence.groupOrder'"). The hot runtime's memory plan caps workers at four, while a
104
+ project beside it, such as a mock-engine or non-React-Native project, gets Vitest's default of one
105
+ fewer than the CPUs. So a config with a native project and another project failed on any machine
106
+ with more than five cores. `hotRuntime: 'auto'` now keeps Vitest's isolation and worker count for
107
+ that project and says why. An explicit `hotRuntime: true` fails with `HOT_RUNTIME_OVERRIDDEN`,
108
+ because a distinct `test.sequence.groupOrder` is what lets the two run as separate groups.
109
+
110
+ - 0063f23: Fix `environment: 'jsdom'` failing to start any test worker
111
+
112
+ Vitest forwards the project's resolve conditions, including the `react-native` condition both
113
+ engines add, to each worker as Node `--conditions` flags. Vitest also loads the test environment
114
+ in that worker. jsdom depends on lru-cache, whose 11.5.3 export map names a `react-native`
115
+ CommonJS build it does not publish, so every worker failed with "Cannot find module
116
+ …/lru-cache/dist/commonjs/react-native/index.min.js". The plugin now preloads a resolver
117
+ recovery in each worker. When Node fails because a package's `react-native` export target does
118
+ not exist, the same export is resolved with the process's other conditions, as Node would
119
+ without `react-native`. Every other resolution is left exactly as Node makes it. jsdom and
120
+ happy-dom now work with both engines, with and without the hot runtime.
121
+
122
+ - 49975e0: Keep Vitest's own settings under `hotRuntime: 'auto'`, including CLI flags
123
+
124
+ - An explicit `test.isolate` (or `--isolate` / `--no-isolate`) is now a reason for `'auto'` to keep
125
+ Vitest's semantics instead of selecting the hot runtime: `true` gets a fresh worker per file,
126
+ `false` one module graph shared across files, as Vitest documents them.
127
+ - On Vitest 4, CLI flags such as `--maxWorkers=1`, `--no-file-parallelism`, `--pool` and
128
+ `--no-isolate` reach the resolved config only after plugins' config hooks run, so `'auto'` chose
129
+ the hot runtime without seeing them. `vitest run --maxWorkers=1` then failed with
130
+ `HOT_MEMORY_UNBOUNDED` and did not exit. The choice is now re-checked against the resolved config
131
+ before any worker starts, per project and on both Vitest majors: `'auto'` falls back to Vitest's
132
+ settings (including its worker count) and says so.
133
+ - An explicit `hotRuntime: true` no longer overrides a configured pool or `test.isolate` with a
134
+ warning, or a conflicting CLI flag silently: it fails at startup with `HOT_RUNTIME_OVERRIDDEN`.
135
+ - `--pool=vmThreads` / `--pool=vmForks` on the command line now fail with `UNSUPPORTED_POOL`, as
136
+ the same pools in the config already did.
137
+ - The engine banner names the hot runtime when it is in use, so a cross-file failure points at
138
+ `hotRuntime: false` from the first line of the log.
139
+
140
+ - 49975e0: Fix inline `test.projects` on Vitest 5 running without vitest-native's setup
141
+
142
+ Vitest 5 lets an inline project (`projects: [{ extends: true, … }]`) share the declaring
143
+ config's Vite server and builds its `test` options from the raw user config, before any
144
+ plugin's `config` hook runs. Those projects lost everything vitest-native adds to `test` —
145
+ setup files, module ownership, env, the hot runtime — and their tests failed to load. The
146
+ plugin now pins each inline project's `root` to the root it inherits anyway, which makes Vitest
147
+ resolve it through the config file with the plugin, as on Vitest 4. This works in a nested
148
+ config too, where `test.sharedViteServer` (read only from the top-level config) cannot help. A
149
+ project that still reaches the run without the plugin's setup fails with `SHARED_VITE_SERVER`.
150
+
151
+ - 49975e0: Fix React Native 0.87 failing to load in a project with no `node_modules` of its own
152
+
153
+ A project whose dependencies are hoisted to a parent directory — a monorepo package, or a Vitest
154
+ project rooted in a subdirectory — had its precompiled React Native registry cached in the OS
155
+ temp directory. Code in that registry resolved React Native's deep self-imports from the cache
156
+ file's location, which cannot see the install, and failed with "Cannot find module
157
+ 'react-native/src/private/…'". The cache now lives under the project's own `node_modules`, or else the nearest
158
+ one above it that contains React Native, and resolution from the registry's own code starts at the
159
+ project, so a cache in the temp directory (a read-only `node_modules`, or macOS's symlinked `/var`)
160
+ works too.
161
+
162
+ - 9ab8270: Report project-source ownership risks consistently for extensionless and platform-specific Node resolution. The warning now distinguishes resolution from proven execution or duplicate instances, and respects Node-owned, delegated and overridden ownership policies. Resolution warnings remain nonfatal.
163
+ - 9ab8270: Bound the native hot runtime by effective host/container memory
164
+
165
+ Hot mode now derives one worker-total plan from `os.totalmem()` and
166
+ `process.constrainedMemory()`, reserves main-process and worker-replacement RSS,
167
+ caps automatic concurrency at four, and recycles one worker at a time on local heap
168
+ or process RSS. It fails before starting more work at the hard RSS boundary so a
169
+ container reports a useful `HOT_MEMORY_BUDGET_EXCEEDED` error instead of relying on
170
+ an OOM kill.
171
+
172
+ Current Vitest batches every file into one unrecyclable task at one worker. Hot mode
173
+ now rejects that configuration with `HOT_MEMORY_UNBOUNDED` rather than silently
174
+ claiming its limits are active. An externally bounded run can explicitly accept the
175
+ risk with `hotRuntime: { allowUnboundedMemory: true }`.
176
+
177
+ The policy is covered by unit and recycle-soak gates plus a packed RN 0.87 / RNTL 14
178
+ Docker gate: 512 MiB and 1 GiB fail closed before registry compilation, while 2 GiB
179
+ caps an eight-worker request to four, passes 405 files, and demonstrably recycles.
180
+
181
+ - 9ab8270: Bound cold React Native registry compilation outside the long-lived Vite process
182
+
183
+ Cold registry cache misses now compile in a short-lived child with a 96 MiB old-space
184
+ cap and a 256 MiB retry only for a recognized V8 heap OOM. The parent validates the
185
+ atomic cache result, warm runs remain spawn-free, and ordinary failures keep the
186
+ visible correctness-preserving per-file fallback. Registry keys now include
187
+ normalized asset extensions, which affect emitted module code.
188
+
189
+ A real 438-module production gate checks artifact parity, persistent-parent RSS,
190
+ warm lookup, bounded latency, and concurrent cold writers.
191
+
192
+ - 290bc53: `vitest-native doctor` no longer warns that Expo core and expo-router setups "can hit known limits" and points at a migration-guide section that no longer exists. Those setups work under the native engine; doctor now reports the Expo version as covered and links the Expo guide, mentioning `vitest-native migrate` for jest-expo projects.
193
+ - ff77511: Install React Native's ErrorUtils under the native engine; gate expo-router end to end
194
+
195
+ `global.ErrorUtils` — React Native's error-guard polyfill, installed on device by
196
+ InitializeCore — is read at module scope by Expo's `Expo.fx`
197
+ (`ErrorUtils.getGlobalHandler()`), so importing anything from `expo` under the
198
+ native engine failed with "ErrorUtils is not defined". The engine now installs the
199
+ real `@react-native/js-polyfills` implementation, resolved through the installed
200
+ React Native and compiled by the same hooks as the rest of its sources, once per
201
+ realm; nothing is hand-mocked.
202
+
203
+ The packed Expo consumer fixture gains an expo-router leg: a real SDK 56 project
204
+ with file-based `app/` routes (a stack layout, a home screen, a dynamic
205
+ `details/[id]` route), tested through expo-router's own `expo-router/testing-library`
206
+ — `renderRouter("./app")`, `testRouter.push`/`back`, `toHavePathname`,
207
+ `useLocalSearchParams` — exactly as its documentation shows and as a jest-expo
208
+ suite already contains. It runs against the real `@react-navigation/*` stack with
209
+ `presets: { navigation: false }` and the jest-compat layer, from a packed install
210
+ in the consumer gate.
211
+
212
+ - 9ab8270: Preserve CommonJS re-exports across hot worker file boundaries
213
+
214
+ Hot cleanup now invalidates stale Node relative-resolution lookups after deleting
215
+ per-file CommonJS cache entries. This prevents later ESM imports of direct CJS
216
+ re-exports from silently receiving empty exports on affected Node versions.
217
+
218
+ The compatibility layer preserves named exports, cycles, retry behavior and fresh
219
+ module identities. It does not evaluate user modules during cleanup; incompatible
220
+ loader behavior fails with an actionable worker-isolation fallback. Runtime
221
+ defaults are unchanged. The Node upstream fix remains the long-term replacement
222
+ for this internal-loader compatibility layer.
223
+
224
+ - e3faa95: Fix three cross-file leaks under the hot runtime and relative paths in `jest.setMock`
225
+
226
+ - A `jest.doMock`/`vi.doMock` issued after a file's last import was applied to the next
227
+ file's imports. Vitest queues such mocks until the next import, and the per-file reset
228
+ cleared the mock registries but not that queue; it now clears it too.
229
+ - React Native Testing Library, which the hot runtime keeps loaded once per worker,
230
+ registered its automatic cleanup and act-environment hooks only in the first file that
231
+ imported it. Later files left their trees mounted, and `screen` could return the previous
232
+ file's tree. When a file imports a resident RNTL, its entry module now re-runs against the
233
+ resident instances, so each file that imports RNTL gets RNTL's own hooks and a file that
234
+ does not import it gets none, as under per-file isolation.
235
+ - `jest.setMock` and `jest.dontMock` resolved a relative path against the jest-compat shim
236
+ instead of the calling test file, so the mock (or unmock) applied to the wrong module.
237
+ Relative paths are now anchored at the caller, as Jest resolves them. Finding the caller
238
+ also no longer skips a test file that lives in a directory named `jest-compat`.
239
+
240
+ - 9ab8270: Reset hot-runtime state before a test file's own setup files run
241
+
242
+ The hot runtime restored the previous file's realm state (fake timers, stubbed
243
+ globals and environment, listeners) from this package's setup file, which Vitest
244
+ runs after the project's own setup files. A project setup file that installs fake
245
+ timers therefore found the previous file's timers still installed and failed with
246
+ "Can't install fake timers twice", failing every file after the first. The reset
247
+ now runs at the file boundary, before any setup file.
248
+
249
+ - 01a9afc: Stop printing React Native's deprecation notices on every import under the native engine. The `react-native` facade read every export while it initialised, and React Native prints the notice for a deprecated or extracted member (`SafeAreaView`, `Clipboard`, `PushNotificationIOS`, …) from that member's getter, so importing only `Pressable` printed all of them. Deprecated members are now exposed as getters and read only when used, so a notice appears only in tests that use the member. The export-name parser also no longer picks up keys from code after the exports object.
250
+ - 8300ec6: Build native-engine preset mocks on first use in each test file
251
+
252
+ The native setup rebuilt every auto-detected preset mock for every test file — in
253
+ a project with twenty presets, about 900 `vi.fn()` mocks per file, most for
254
+ packages the file never imports. Vitest keeps every mock it has created (for
255
+ `vi.clearAllMocks()`), so under the hot runtime each file's unused mocks stayed
256
+ reachable for the rest of the run: worker heap grew about 4 MB per file and a
257
+ 1,000-file single-worker run ran out of memory. Each preset mock is now built
258
+ the first time a file uses it, and still fresh for every file. On the same run,
259
+ worker heap after 562 tests fell from about 2.4 GB to about 0.45 GB and 1,000
260
+ files complete in about 1.5 GB.
261
+
262
+ - 99f3013: Fix the matcher type augmentations for Vitest 4 and Vitest 5. Under Vitest 4, `expect(x).toHaveAnimatedStyle(...)` and `toHaveAnimatedProps(...)` from `vitest-native/matchers` were untyped: the published declaration file augmented the `vitest` module without referencing it, which Vitest 4's type layout needs for the augmentation to merge. The declarations now reference `vitest`, and both `vitest-native/matchers` and `vitest-native/rntl-matchers` use Vitest 5's `Assertion<R, T>` type parameters. The matchers are typed on both majors; a Vitest 4 project that checks declaration files (`skipLibCheck: false`) reports TS2428 for the differing type parameters.
263
+ - 525eb42: Translate jest-expo presets in `vitest-native migrate`
264
+
265
+ `migrate` reported `preset: 'jest-expo'` as needing attention and pointed at known limits
266
+ that no longer apply. It now translates the preset: `jest-expo` and `jest-expo/ios` become
267
+ `reactNative()`, `jest-expo/android` becomes `reactNative({ platform: 'android' })`, and
268
+ `jest-expo/universal`, `jest-expo/web` and `jest-expo/node` are reported with what to do
269
+ instead. jest-expo does not mock React Navigation, so when a `@react-navigation/*` package is
270
+ installed (which activates the navigation preset) the suggested config sets
271
+ `presets: { navigation: false }`, keeping screens in real navigators as under Jest; a
272
+ project with its own root `__mocks__/@react-navigation` keeps the preset. The packed Expo
273
+ SDK 57 consumer gate now also runs expo-router's testing library under the configuration
274
+ `migrate --write` generates from a jest-expo setup.
275
+
276
+ - 4e5130f: Navigation preset matches @react-navigation/native's shape; a disabled preset's package detects like any other
277
+
278
+ Two gaps that both surfaced by rendering router-driven screens under the native
279
+ engine — the shape most Expo apps have.
280
+
281
+ `createNavigatorFactory(Navigator)` now returns the real factory shape, yielding
282
+ `{ Navigator, Screen, Group }`. It returned a bare mock function whose result was
283
+ undefined, so any library building on the public factory API — expo-router extracts
284
+ its `Screen`/`Group` primitives through `createNavigatorFactory({})()` — failed at
285
+ import with "Cannot read properties of undefined (reading 'Screen')". The preset
286
+ also gains the exports `@react-navigation/native` adds on top of core:
287
+ `LinkingContext`, `LocaleDirContext`, `UNSTABLE_UnhandledLinkingContext`,
288
+ `DefaultTheme`, `DarkTheme` (real colors and platform font stacks), `createStaticNavigation`,
289
+ `ServerContainer`, `useLinkBuilder`, `useLinkProps`, `useLocale`, `useRoutePath`.
290
+ `ThemeContext` is seeded with `DefaultTheme`, as in the real package.
291
+
292
+ Disabling a preset — `presets: { navigation: false }` — now returns its packages to
293
+ ordinary ecosystem detection. Detection used to skip every preset package
294
+ unconditionally, so turning the preset off un-shadowed `@react-navigation/*` but
295
+ left it undetected: nothing compiled its untranspiled `lib/module` source and it
296
+ failed at load. That is the configuration under which the real React Navigation
297
+ stack, and expo-router's own `expo-router/testing-library` on top of it, run under
298
+ the native engine — `renderRouter` renders and `router.push` navigates.
299
+
300
+ - 3f62964: `jest.requireActual` and `jest.requireMock` now apply the project's `resolve.alias` string entries. A partial mock such as `jest.mock('@/services/api', () => ({ ...jest.requireActual('@/services/api'), fn: jest.fn() }))` threw "Cannot find module" because `requireActual` resolves through Node, which does not apply Vite's aliases. Aliases match on the whole specifier or a `/` boundary (an `@` alias does not capture `@scope/pkg`), the longest match wins, and an extensionless result is resolved with the platform's extension order (`@/Button` → `Button.ios.tsx`). Regex aliases and custom resolvers cannot reach the test worker; when one is configured, an unresolved specifier reports that instead of a bare "Cannot find module".
301
+ - d4ae5bf: Report the resolver-agreement warning (`'x' resolves to two different files`) only under `diagnostics`. The check compares Node's resolution against the package manifest and cannot see Vite's module graph, so it fired for packages that only Node ever requires — `test-renderer` (required by React Native Testing Library), `nanoid` (required by postcss) and Babel's source-map packages — printing on every test file. The warning now also states that it is a risk rather than a proven duplicate, and that its comparison uses Vite's default main fields.
302
+ - 963b35e: Type React Native Testing Library's matchers on RNTL 12 and 13
303
+
304
+ `vitest-native/rntl-matchers` imported RNTL's matcher interface from
305
+ `dist/matchers/types`, a path that exists only from RNTL 14; RNTL 12 and 13 keep it
306
+ under `build/`. On those versions the import resolved to nothing, and under
307
+ `skipLibCheck: true` the failure was silent: `toHaveTextContent`, `toBeVisible`,
308
+ `toBeDisabled` and the other matchers stayed untyped although the peer range is
309
+ `>=12 <15`. The entry now declares the interface itself, taking the element type from
310
+ RNTL's public `screen` API, and a test compares its members with the installed RNTL's
311
+ on each supported major. Typechecked against RNTL 12.9, 13.3 and 14.0 with Vitest 4
312
+ and 5 and TypeScript 6 and 7.
313
+
314
+ - 8893464: Fix `vitest-native/rntl-matchers` under TypeScript 7 with RNTL 14. RNTL 14 adds its matchers to the global `jest.Matchers<R>`, which Vitest's `JestAssertion` extends with `R = void`; the entry added them again with Vitest's assertion type, and TypeScript 7 rejects the two differing declarations (TS2320) for projects that typecheck declaration files (`skipLibCheck: false`). The entry now uses the same instantiation, so the declarations agree and the matchers stay typed.
315
+ - 9ab8270: Add conservative automatic selection for the bounded native hot runtime
316
+
317
+ `hotRuntime: "auto"` enables persistent native workers only when the current
318
+ configuration has recyclable task boundaries, enough host/container memory for at
319
+ least two workers, and no explicitly selected pool; otherwise it preserves stock
320
+ per-file isolation. Selection runs after other Vite config hooks, so
321
+ later-contributed pools and setup files cannot create a mixed runtime. (In this
322
+ release `'auto'` also becomes the default, falls back quietly unless set explicitly
323
+ or `diagnostics` is on, and includes suites migrated from Jest — see the minor
324
+ changes above.)
325
+
326
+ A packed consumer gate proves safe enablement and the one-worker and explicit-pool
327
+ fallbacks. Explicit `hotRuntime: true` keeps its existing fail-closed semantics.
328
+
329
+ - 9ab8270: Verify and restore hot-runtime shared-realm state between test files
330
+
331
+ Hot mode now uses an ordered state manifest for Vitest timers and stubs, native
332
+ boundary overrides, known React Native state, environment changes, process and RN
333
+ listeners, global and console property descriptors, ErrorUtils, and the Expo
334
+ compatibility runtime. Every restore is followed by final-realm verification, and a
335
+ failure names the responsible entry instead of surfacing later as an order-dependent
336
+ test failure.
337
+
338
+ An adversarial two-file suite contaminates every supported surface. A mutation gate
339
+ disables all eleven restore actions one at a time and requires each omission to fail,
340
+ covering both the normal precompiled registry and the resident-RN fallback path.
341
+
3
342
  ## 0.13.0
4
343
 
5
344
  ### Minor Changes
package/README.md CHANGED
@@ -4,9 +4,11 @@
4
4
 
5
5
  Run your React Native tests under Vitest, against **real React Native** — the same JavaScript that ships in your app, with only the native-module boundary mocked. That is the default and the point of the project. A lightweight pure-JS mock engine is available as an opt-in for fast, RN-free unit tests.
6
6
 
7
- > **Beta.** The release-supported native engine is validated across React Native 0.81–0.86,
8
- > Vite 6–8, Vitest 4, RNTL 12–14, bare apps, Expo 56, and hoisted monorepos. The optional
9
- > hot runtime remains experimental because it uses Vitest's experimental custom-pool APIs.
7
+ > **Beta.** The release-supported native engine is validated across React Native 0.81–0.87,
8
+ > Vite 6–8, Vitest 4–5, RNTL 12–14, bare apps, Expo SDK 57 (including expo-router's own testing
9
+ > library), and hoisted monorepos. The hot
10
+ > runtime (on by default where it can be bounded) is marked experimental because it uses Vitest's
11
+ > experimental custom-pool APIs.
10
12
  >
11
13
  > Maintained successor to [`vitest-community/vitest-react-native`](https://github.com/vitest-community/vitest-react-native) — same core idea (externalize RN, run its real JS under Node), rebuilt for modern Vitest (4+). Coming from it? See [Migrating from `vitest-react-native`](#migrating-from-vitest-react-native).
12
14
 
@@ -146,7 +148,7 @@ export default defineConfig({
146
148
  diagnostics: false, // Enable verbose logging
147
149
  assetExts: [".lottie"], // Additional asset extensions to stub
148
150
  transform: [], // Extra native-engine packages to Flow/TS transform
149
- hotRuntime: false, // Experimental persistent RN workers
151
+ hotRuntime: "auto", // 'auto' (default) | true | false | HotRuntimeOptions
150
152
  }),
151
153
  ],
152
154
  });
@@ -161,7 +163,35 @@ export default defineConfig({
161
163
  | `diagnostics` | `boolean` | `false` | Log plugin activity to the console for debugging. |
162
164
  | `assetExts` | `string[]` | `[]` | Additional file extensions to stub as asset imports (beyond the built-in set). |
163
165
  | `transform` | `string[]` | `[]` | **`engine: 'native'` only.** Extra `node_modules` packages whose source the native engine should transform (Flow/TS/JSX stripped) as it loads them — for third-party RN libraries that ship untranspiled source (e.g. `react-native-reanimated`). Analogous to Jest's `transformIgnorePatterns` allowlist. |
164
- | `hotRuntime` | `boolean \| HotRuntimeOptions` | `false` | **Experimental, `engine: 'native'` only.** Reuse workers while keeping app/test modules isolated per file. See [Hot runtime](#hot-runtime). |
166
+ | `hotRuntime` | `boolean \| 'auto' \| HotRuntimeOptions` | `'auto'` | `engine: 'native'` only. Reuse workers while keeping app/test modules isolated per file. `'auto'` (the default) uses it when the run can be bounded and recycled, and per-file isolation otherwise; `false` always isolates per worker. See [Hot runtime](#hot-runtime). |
167
+
168
+ ### Experimental Metro configuration
169
+
170
+ Pass `metroConfig: true` to use your project's Metro source-extension order and
171
+ asset list in both Vite and Node resolution. This is opt-in while the framework
172
+ and package-manager compatibility matrix is being validated:
173
+
174
+ ```ts
175
+ reactNative({ metroConfig: true });
176
+ // Config outside the project root:
177
+ reactNative({ metroConfig: { configFile: "../../metro.config.cjs" } });
178
+ ```
179
+
180
+ Expo's defaults prefer TypeScript over JavaScript when both variants exist;
181
+ bare React Native's defaults prefer JavaScript. The profile is evaluated in a
182
+ short-lived child using the project's own Metro tooling. Explicit `assetExts`
183
+ additions still apply. Metro transforms are not installed: source formats such as
184
+ SVG need a corresponding Vitest/Vite transform.
185
+
186
+ A custom `resolver.resolveRequest` is code and does not run under Vitest: the
187
+ source and asset extensions still apply, and a warning names the gap. Where one of
188
+ its redirects matters to tests, reproduce it with `resolve.alias`. Package
189
+ main fields and conditions remain governed by the engine's ownership policy;
190
+ `diagnostics: true` reports the observed Metro values. Config is evaluated on
191
+ startup; changing it requires restarting the run.
192
+
193
+ Default: `false`. Findings and remaining gates are recorded in
194
+ [the investigation log](docs/metro-profile-investigation.md).
165
195
 
166
196
  ### `engine`
167
197
 
@@ -186,6 +216,12 @@ Choose how React Native is provided to your tests:
186
216
  reactNative({ engine: "native" });
187
217
  ```
188
218
 
219
+ On the first cold run, the native engine compiles React Native's synchronous module graph into a
220
+ factory registry in a short-lived, heap-bounded child process. The child exits before test workers
221
+ start, so Babel's compilation heap does not become a permanent Vite-process RSS watermark. Later
222
+ runs validate and reuse the cache in-process without launching the compiler. A failed optimization
223
+ remains visible and falls back to the slower per-file loader without changing test results.
224
+
189
225
  #### Fidelity
190
226
 
191
227
  Jest's `react-native` preset replaces many real modules with stubs, so behavior they
@@ -204,8 +240,34 @@ the cross-check/fidelity harnesses in the repository's `bench/` directory.
204
240
 
205
241
  #### Hot runtime
206
242
 
207
- `engine: 'native'` normally uses Vitest's safest isolation model: each test file gets a fresh
208
- worker, so React Native reloads for every file. Large suites can opt into persistent workers:
243
+ Vitest's default isolation gives each test file a fresh worker, so React Native would reload for
244
+ every file. By default (`hotRuntime: 'auto'`) the native engine instead reuses workers and resets
245
+ modules per file whenever that can be done safely:
246
+
247
+ `'auto'` selects persistent workers when the current scheduler provides recyclable task boundaries,
248
+ the host/container memory plan admits at least two workers, no other pool was explicitly
249
+ selected, and `test.isolate` is not set explicitly — an explicit Vitest isolation choice, `true` or
250
+ `false`, is always kept. The same holds for CLI flags (`--pool`, `--isolate`, `--no-isolate`,
251
+ `--maxWorkers=1`, `--no-file-parallelism`). With `hotRuntime: true` instead, any of these fails at
252
+ startup with `HOT_RUNTIME_OVERRIDDEN` rather than being overridden. `'auto'` also keeps Vitest's
253
+ isolation when another project in the same `sequence.groupOrder` runs a different worker count,
254
+ which Vitest does not allow; give the native project its own `test.sequence.groupOrder` to keep hot.
255
+ Suites migrated from Jest (`jestMockTransform()`, the jest-compat setup) are included: the
256
+ jest-compat surface — `jest.mock` in its forms, runtime mocks, spies, timers, React Native Testing
257
+ Library cleanup — has its own cross-file isolation gate under the hot runtime. The decision runs
258
+ after other Vite config hooks, so a pool contributed by a later plugin is included rather than
259
+ producing a mixed runtime. When it falls
260
+ back to per-file isolation it does so quietly; `diagnostics: true`, or setting `hotRuntime: 'auto'`
261
+ explicitly, prints the reason. To always isolate per worker:
262
+
263
+ ```ts
264
+ reactNative({
265
+ engine: "native",
266
+ hotRuntime: false,
267
+ });
268
+ ```
269
+
270
+ To require hot mode and fail closed when it cannot be bounded, use the explicit form:
209
271
 
210
272
  ```ts
211
273
  reactNative({
@@ -214,22 +276,26 @@ reactNative({
214
276
  });
215
277
  ```
216
278
 
217
- The hot runtime keeps React Native's externalized module graph resident while Vitest still resets
218
- the app/test module graph for every file. It also restores direct `process.env` mutations,
219
- file-created globals, RN event subscriptions, dimensions, timers, and plugin mock state between
220
- files. A dedicated one-worker CI test exercises this cross-file isolation contract.
279
+ The hot runtime keeps React Native's precompiled factory registry and worker realm warm while
280
+ resetting the registry's module instances and the app/test module graph for every file. An ordered
281
+ state manifest also restores and verifies timers/Vitest stubs, direct `process.env` changes,
282
+ process and RN listeners, complete global and console property descriptors, known RN state,
283
+ ErrorUtils, Expo runtime state, and plugin boundary mocks. A mutation gate removes each of its
284
+ eleven restore actions in turn and requires the cross-file isolation suite to fail by name.
285
+
286
+ When hot is enabled, the plugin derives a worker-total memory plan from the lower of host and
287
+ container/cgroup memory. It reserves main-process and replacement headroom, caps automatic
288
+ concurrency at four, recycles workers on local heap or process RSS, and stops before starting more
289
+ work at the hard RSS boundary. Run with `diagnostics: true` or `vitest-native doctor` to see the
290
+ chosen envelope.
221
291
 
222
- **Known limitation.** Because React Native stays resident, state held inside React Native's own
223
- internal modules is _not_ reset between files — the per-file reset deliberately does not reach into
224
- third-party or RN-internal module internals, because doing so generically is unsafe. Suites that
225
- lean on deep resident-RN-internal state can therefore see cross-file interference under the hot
226
- runtime that they would not see under the default per-file isolation. The clearest example is heavy
227
- cross-file `Animated` usage, where animations driven in one file can alter how a later file renders.
228
- The tell-tale sign is a test that passes in isolation but fails when run after other files; if you
229
- see that, move the affected suite (or the project) back to the default per-file isolation. This is
230
- why the hot runtime is opt-in and experimental rather than the default; closing the gap for all
231
- suites depends on a per-file module reset inside a persistent worker that Vitest does not yet
232
- provide.
292
+ **Known limitation.** No shared-realm sanitizer can generically discover arbitrary mutable state in
293
+ every resident third-party singleton. The registry resets React Native's own in-memory module
294
+ instances, and the manifest handles the supported runtime surfaces above; unknown process-wide
295
+ state is still the library's or test fixture's responsibility. A test that passes alone but fails
296
+ after another file is a correctness signal: set `hotRuntime: false` for that suite and report the
297
+ small reproduction. The hot runtime depends on Vitest's custom worker APIs, which Vitest labels
298
+ experimental.
233
299
 
234
300
  For additional leak containment:
235
301
 
@@ -244,15 +310,20 @@ reactNative({
244
310
  });
245
311
  ```
246
312
 
247
- Recycling is applied between Vitest scheduler tasks. Vitest can place multiple files in one task,
248
- especially with `maxWorkers: 1`, so a worker cannot be retired in the middle of that batch. Use
249
- more than one worker when strict per-file retirement matters. `preserveGlobals` is an exact
250
- allowlist for registries created by resident external dependencies; Storybook's preview registry
251
- is preserved automatically.
313
+ Recycling is applied between Vitest scheduler tasks. Current Vitest batches every file into one
314
+ uninterruptible task at `maxWorkers: 1`, so the default `'auto'` keeps per-file isolation there and
315
+ `hotRuntime: true` fails that configuration rather than claim an inert memory bound. Use at least
316
+ two workers for hot mode. If an external scheduler
317
+ already provides a hard boundary, you can deliberately accept the risk with
318
+ `hotRuntime: { allowUnboundedMemory: true }`; this disables the automatic worker cap and
319
+ process-RSS enforcement and prints a warning when the batch is observed. `preserveGlobals` is an
320
+ exact allowlist for registries created by resident external dependencies; Storybook's preview
321
+ registry is preserved automatically.
252
322
 
253
323
  This mode uses Vitest's custom pool and worker APIs, so it remains experimental. CI runs the
254
- complete native suite under both the lockfile Vitest and the newest supported Vitest 4 release,
255
- plus a generated 100-file isolation soak and an end-to-end memory-triggered recycling test.
324
+ complete native suite under both the lockfile Vitest and the newest supported Vitest release,
325
+ plus a generated 100-file isolation soak, an end-to-end memory-triggered recycling test, and a
326
+ packed auto-selection matrix covering enablement and every guarded fallback class.
256
327
 
257
328
  ---
258
329
 
@@ -490,20 +561,26 @@ renders through real React Native).
490
561
 
491
562
  ### Expo
492
563
 
493
- The `expo` preset shadows the common Expo modules (`expo-constants`, `expo-status-bar`, `expo-font`,
494
- `expo-asset`, `expo-splash-screen`, `expo-linking`) the way `jest-expo` mocks them. A component that
495
- imports those renders under the native engine with no extra setup — there's a gated proof in
496
- `tests-native/expo.test.tsx`. Two honest caveats:
497
-
564
+ Expo apps need no Expo-specific package. The `expo` preset shadows the common Expo modules
565
+ (`expo-constants`, `expo-status-bar`, `expo-font`, `expo-asset`, `expo-splash-screen`,
566
+ `expo-linking`) the way `jest-expo` mocks them, and Expo's own JavaScript — `expo` itself,
567
+ expo-router and React Navigation — runs for real under the native engine.
568
+
569
+ - **Coming from jest-expo:** `npx vitest-native migrate --write` translates the `jest-expo`
570
+ presets (`jest-expo/android` → `platform: 'android'`) and, because jest-expo does not mock React
571
+ Navigation, turns the navigation preset off when a `@react-navigation/*` package is installed.
572
+ - **expo-router screens:** `expo-router/testing-library` (`renderRouter`, `testRouter`,
573
+ `toHavePathname`) runs as written with the jest-compat layer. From SDK 57 expo-router bundles its
574
+ own React Navigation; before SDK 57, also set `presets: { navigation: false }`.
498
575
  - **Expo modules without a built-in preset** (e.g. `expo-image`, `expo-haptics`) still need a
499
- setup-file `vi.mock` at a Vite-managed boundary. The native engine externalizes native-side
500
- libraries to Node, so imports made entirely inside that externalized graph cannot be intercepted
501
- by Vitest's mocker.
576
+ setup-file `vi.mock`.
502
577
  - **Expo SDK trails React Native.** Pin your `react-native` to the version your Expo SDK supports
503
- (which is within this plugin's validated range), not the newest RN release.
578
+ (SDK 54 and later are within this plugin's validated range), not the newest RN release.
504
579
 
505
- A packed Expo 56 consumer is installed from the release tarball and tested in CI. That gate covers
506
- Expo preset auto-detection, `expo-constants`, `expo-status-bar`, real RN rendering, and RNTL 13.
580
+ A packed Expo SDK 57 app is installed from the release tarball and tested in CI: Expo module
581
+ auto-detection and rendering, expo-router's testing library against file-based `app/` routes, and
582
+ the same routes under the configuration `migrate` generates from a jest-expo setup. See the
583
+ [Expo guide](https://danfry1.github.io/vitest-native/guide/expo).
507
584
 
508
585
  ---
509
586
 
@@ -557,6 +634,12 @@ with a worked real-app example, is in **[docs/migrating-from-jest.md](docs/migra
557
634
 
558
635
  ## Troubleshooting
559
636
 
637
+ **`npm error Cannot read properties of null (reading 'edgesOut')` during install**
638
+ npm 10 (the version bundled with Node 22) crashes while resolving Vite 8.2+'s optional peer
639
+ chain when the project pins Vitest 4, because that chain resolves to the latest Vitest (5.x).
640
+ This is an npm bug, fixed in npm 11 ([vitest#11245](https://github.com/vitest-dev/vitest/issues/11245)).
641
+ Upgrade npm (`npm install --global npm@11`), or use pnpm, Yarn or Bun.
642
+
560
643
  **`@react-native/babel-preset not found — using the mock engine`**
561
644
  You asked for the default (`auto`) engine but the native babel deps aren't installed, so it
562
645
  fell back to the mock engine. To run real React Native, install them:
@@ -604,9 +687,9 @@ export default defineConfig({
604
687
  });
605
688
  ```
606
689
 
607
- The experimental `reactNative({ hotRuntime: true })` also helps: it keeps React Native resident
608
- across files (loaded once per worker instead of per file) and recycles workers on a memory/file
609
- budget.
690
+ The hot runtime (the default where it can be bounded) also helps: it keeps React Native's precompiled
691
+ factory registry warm, resets its module instances from memory per file, and recycles workers on a
692
+ memory/file budget.
610
693
 
611
694
  **`Vitest caught N unhandled errors` in error-boundary tests**
612
695
  A test that intentionally throws inside a component (to exercise an error boundary) makes React log
@@ -873,10 +956,17 @@ that API.
873
956
 
874
957
  Every release must pass:
875
958
 
876
- - Linux on Node 20.19 and 22.13, plus macOS and Windows on Node 22.13.
959
+ - Linux on Node 20.19, 22.13, and 24, plus macOS and Windows on Node 22.13.
877
960
  - The mock, native iOS, native Android, hot-runtime, isolation, and 100-file soak suites.
878
- - React Native 0.81–0.86 against both locked and newest-supported Vitest 4.
879
- - Packed bare RN 0.83/RNTL 12, Expo 56/RNTL 13, Vite 8 monorepo/RNTL 14, and RN 0.86 consumers.
961
+ - React Native 0.81–0.87 against both locked and newest-supported Vitest, plus the Vitest 4 floor
962
+ on 0.81 and 0.87.
963
+ - Vitest's own behaviour under the defaults, on Vitest 5 and the Vitest 4 floor: config and CLI
964
+ flags, projects, watch mode, the jsdom and happy-dom environments, `--typecheck`, `vitest bench`,
965
+ and the HTML reporter.
966
+ - Packed consumers: bare RN 0.83/RNTL 12, a Jest-migration project, Expo SDK 57/RNTL 13 (with
967
+ expo-router and a `migrate`-generated jest-expo config), a mock-engine RNTL 14 project, npm- and
968
+ pnpm-workspace monorepos on Vite 8, and an RN 0.86 Android project.
969
+ - Packed V8 and Istanbul coverage maps/counts matching default isolation exactly under hot workers.
880
970
  - Mock-versus-real-RN behavioral cross-checks, example-app tests, typecheck, lint, formatting, and
881
971
  package export analysis.
882
972
 
@@ -895,9 +985,9 @@ see [versioning and stability](docs/versioning.md).
895
985
  | -------------------------------------------- | ----------------------------------------- |
896
986
  | `react` | >= 18; use RN's matching React version |
897
987
  | `vite` | ^6.4.2, ^7.3.2, or ^8.0.5 |
898
- | `vitest` | 4.x |
988
+ | `vitest` | 4.x or 5.x |
899
989
  | `node` | >= 20.19; RN/RNTL may impose a higher floor |
900
- | `react-native` (native engine) | 0.81–0.86 validated |
990
+ | `react-native` (native engine) | 0.81–0.87 validated |
901
991
  | `@react-native/babel-preset` (native engine) | Match the installed React Native minor |
902
992
  | `@testing-library/react-native` (optional) | 12.x, 13.x, or 14.x |
903
993