vitest-native 0.14.1 → 0.15.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.
- package/README.md +11 -10
- package/dist/cli.d.mts +9 -1
- package/dist/cli.mjs +2609 -361
- package/dist/context.d.mts +19 -0
- package/dist/context.mjs +47 -1
- package/dist/docs-url.d.mts +4 -0
- package/dist/docs-url.mjs +9 -0
- package/dist/errors.d.mts +21 -1
- package/dist/hang-watch-setup.mjs +55 -0
- package/dist/hang-watch.d.mts +56 -0
- package/dist/hang-watch.mjs +343 -0
- package/dist/helpers.cjs +24 -53
- package/dist/helpers.mjs +22 -1
- package/dist/host-D0r3P_T1.mjs +1985 -0
- package/dist/{index-aNBCTfA5.d.mts → index-JOR602XU.d.mts} +105 -2
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +723 -149
- package/dist/jest-compat/aliases.d.mts +1 -0
- package/dist/jest-compat/aliases.mjs +11 -0
- package/dist/jest-compat/interop.mjs +1 -1
- package/dist/jest-compat/jest-object.mjs +23 -5
- package/dist/jest-compat/node-registry.mjs +836 -68
- package/dist/jest-compat/setup.mjs +205 -12
- package/dist/jest-compat.cjs +383 -47
- package/dist/jest-compat.d.cts +19 -2
- package/dist/jest-compat.d.mts +19 -2
- package/dist/jest-compat.mjs +232 -47
- package/dist/matchers.d.cts +0 -1
- package/dist/matchers.d.mts +0 -1
- package/dist/native/assets.mjs +3 -1
- package/dist/native/babel-caller.d.mts +13 -0
- package/dist/native/babel-caller.mjs +24 -0
- package/dist/native/babel-toolchain.mjs +27 -3
- package/dist/native/boundary.mjs +45 -8
- package/dist/native/bounded-process.mjs +63 -5
- package/dist/native/bridge-client.mjs +133 -0
- package/dist/native/bridge-server.mjs +215 -0
- package/dist/native/bridge-thread.mjs +79 -0
- package/dist/native/bridge.mjs +512 -0
- package/dist/native/compile-error.mjs +120 -0
- package/dist/native/explain.mjs +3 -2
- package/dist/native/expo-module-mocks.mjs +2 -0
- package/dist/native/export-condition-recovery.mjs +20 -99
- package/dist/native/hooks.mjs +256 -133
- package/dist/native/jest-resolvers.mjs +94 -0
- package/dist/native/library-jest.mjs +352 -0
- package/dist/native/loader.mjs +167 -73
- package/dist/native/match.mjs +67 -7
- package/dist/native/module-reset.mjs +44 -49
- package/dist/native/ownership-ledger.d.mts +87 -0
- package/dist/native/ownership-ledger.mjs +524 -0
- package/dist/native/ownership.d.mts +20 -0
- package/dist/native/ownership.mjs +114 -0
- package/dist/native/registry-compiler.mjs +39 -5
- package/dist/native/registry-process.mjs +327 -28
- package/dist/native/registry.mjs +752 -200
- package/dist/native/resident-health.mjs +1 -0
- package/dist/native/resolve.d.mts +7 -0
- package/dist/native/resolve.mjs +119 -4
- package/dist/native/rntl-hooks.mjs +9 -5
- package/dist/native/rntl-text-host.mjs +5 -15
- package/dist/native/root-spelling.d.mts +6 -0
- package/dist/native/root-spelling.mjs +77 -0
- package/dist/native/runner.mjs +2 -19
- package/dist/native/setup.mjs +119 -38
- package/dist/native/shared-resolver.d.mts +141 -0
- package/dist/native/shared-resolver.mjs +719 -0
- package/dist/native/test-runner.mjs +26 -0
- package/dist/native/transform.mjs +18 -22
- package/dist/native/worker.mjs +9 -4
- package/dist/node-dispatch.mjs +293 -0
- package/dist/{preset-map-CogjYmSw.mjs → preset-map-DdAexIwz.mjs} +113 -2
- package/dist/{presets-CXDyg51l.mjs → presets-_EaSw29m.mjs} +710 -130
- package/dist/presets.d.mts +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/rntl-matchers.d.ts +11 -15
- package/dist/rntl-support.mjs +28 -13
- package/dist/root-mocks-BNXeosbR.mjs +155 -0
- package/dist/serializer.cjs +7 -5
- package/dist/serializer.d.cts +7 -5
- package/dist/serializer.d.mts +7 -5
- package/dist/serializer.mjs +7 -5
- package/dist/setup.mjs +26 -27
- package/docs/migrating-from-jest.md +9 -232
- package/docs/migrating-from-vitest-react-native.md +4 -4
- package/docs/release-readiness.md +9 -11
- package/docs/versioning.md +38 -9
- package/package.json +59 -33
- package/dist/host-BAAAlSkO.mjs +0 -1028
|
@@ -1,238 +1,15 @@
|
|
|
1
1
|
# Migrating an existing Jest suite to vitest-native
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
`@react-native/jest-preset`, jest-native matchers, recorded snapshots). The `vitest-native/jest-compat`
|
|
6
|
-
layer clears the *API coupling* mechanically; the rest is a small, well-defined per-suite cleanup.
|
|
3
|
+
The migration guide is on the documentation site:
|
|
4
|
+
**https://danfry1.github.io/vitest-native/migration/from-jest**
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
pass counts are observations rather than capability verdicts.
|
|
6
|
+
Start with `npx vitest-native migrate`, which reads your Jest config and prints a report and a
|
|
7
|
+
suggested config. `migrate --write` saves the config.
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
Messages from vitest-native 0.14 and earlier link to this file. The page each one means:
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```ts
|
|
17
|
-
// vitest.config.mts
|
|
18
|
-
import { defineConfig } from "vitest/config";
|
|
19
|
-
import { reactNative } from "vitest-native";
|
|
20
|
-
import { jestCompatAliases, jestCompatSetup, jestMockTransform } from "vitest-native/jest-compat";
|
|
21
|
-
|
|
22
|
-
export default defineConfig({
|
|
23
|
-
plugins: [reactNative({ engine: "native" }), jestMockTransform()], // or engine: "mock"
|
|
24
|
-
resolve: {
|
|
25
|
-
dedupe: ["react", "react-test-renderer", "react-is"],
|
|
26
|
-
alias: { ...jestCompatAliases() },
|
|
27
|
-
},
|
|
28
|
-
test: {
|
|
29
|
-
globals: true,
|
|
30
|
-
environment: "node",
|
|
31
|
-
setupFiles: [jestCompatSetup],
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
What each piece does:
|
|
37
|
-
|
|
38
|
-
| Piece | Clears |
|
|
11
|
+
| Message | Where to read |
|
|
39
12
|
|---|---|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
| `
|
|
43
|
-
| `jestCompatAliases()` → `@testing-library/jest-native/extend-expect` | No-ops it — vitest-native already registers the jest-native matchers (`toHaveStyle`, `toBeVisible`, …). |
|
|
44
|
-
|
|
45
|
-
After this, `jest.fn`, `jest.spyOn`, `jest.useFakeTimers`, `jest.requireActual`, and top-level
|
|
46
|
-
`jest.mock` / `jest.unmock` / `jest.doMock` calls all work unchanged.
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## 2. Per-suite cleanup still required
|
|
51
|
-
|
|
52
|
-
These are the things the compat layer **cannot** do for you. Each is small and mechanical.
|
|
53
|
-
|
|
54
|
-
### 2a. Top-level `jest.mock(...)` — automated by `jestMockTransform()`
|
|
55
|
-
Vitest only **hoists** mock calls made on the `vi` / `vitest` identifier. A top-level
|
|
56
|
-
`jest.mock('react-native', factory)` would otherwise run *after* imports and silently not apply.
|
|
57
|
-
|
|
58
|
-
**`jestMockTransform()` (section 1) handles this for you** — it rewrites top-level
|
|
59
|
-
`jest.mock` / `jest.unmock` / `jest.doMock` / `jest.doUnmock` to the hoisted `vi.*` form, and
|
|
60
|
-
runs each `mock`/`doMock` factory's return through **Jest's CommonJS interop** so the two most
|
|
61
|
-
common Jest manual-mock shapes resolve the way they do under Jest:
|
|
62
|
-
|
|
63
|
-
```ts
|
|
64
|
-
jest.mock('./Icon', () => () => null); // function factory → usable as `import Icon from`
|
|
65
|
-
jest.mock('./api', () => ({ get: vi.fn() })); // named-only → `import api from` gets the object
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
(Jest treats a factory return as `module.exports`; Vitest treats it as an ES namespace. The
|
|
69
|
-
wrapper bridges that. A factory already returning an ES shape — `__esModule` or an explicit
|
|
70
|
-
`default` — is left as-is.) So you can leave existing `jest.mock(...)` calls unchanged. It keys
|
|
71
|
-
on the literal `jest.mock` member form, not `jest` aliased to another local name.
|
|
72
|
-
|
|
73
|
-
…and in most cases you can **delete** third-party native-lib mocks entirely — see 2c.
|
|
74
|
-
|
|
75
|
-
### 2b. Upgrade RNTL to 12–14 (recommended)
|
|
76
|
-
The `@jest/globals` alias unblocks RNTL < 12, but **upgrading to `@testing-library/react-native@^12`
|
|
77
|
-
is the cleaner fix** (12 dropped the `@jest/globals` dependency). vitest-native supports RNTL
|
|
78
|
-
12–14. RNTL 14 requires Node 22.13 or 24+ and makes rendering APIs async, so await `render` and
|
|
79
|
-
other APIs as described in its migration guide.
|
|
80
|
-
|
|
81
|
-
### 2c. Delete third-party native-lib mocks — they're automatic now
|
|
82
|
-
You do **not** need `jest.mock('react-native-reanimated', …)`, safe-area's `jest/mock`,
|
|
83
|
-
gesture-handler's jestSetup, etc. vitest-native **auto-detects** installed third-party libraries and
|
|
84
|
-
shadows their native runtimes with built-in presets, under **both** engines. Just have the package
|
|
85
|
-
installed; delete the manual mock. (Reanimated, Gesture Handler, Safe Area, Navigation, Screens and
|
|
86
|
-
AsyncStorage are covered out of the box. Validated under the native engine —
|
|
87
|
-
`tests-native/third-party-stack.test.tsx`. Expo modules need no mock either: under the native engine
|
|
88
|
-
they run their own JavaScript, as under jest-expo, and the `expo` preset applies only under the mock
|
|
89
|
-
engine, or when you turn it on with `presets: { expo: true }` or list it in a `presets` array.)
|
|
90
|
-
|
|
91
|
-
### 2d. Snapshots: keep Jest's and Vitest's apart, then record Vitest's
|
|
92
|
-
Jest's `.snap` files are not something Vitest can check against, for two reasons.
|
|
93
|
-
|
|
94
|
-
**Keys differ.** Vitest names a snapshot by joining the `describe` and test names with ` > `
|
|
95
|
-
(`a > b 1`), Jest with a space (`a b 1`). A hint is `name > hint 1` under Vitest, `name: hint 1`
|
|
96
|
-
under Jest. Only a top-level test without a hint has the same key in both. For every other entry
|
|
97
|
-
Vitest finds no snapshot and treats it as new:
|
|
98
|
-
|
|
99
|
-
- Locally, it writes the new entry and the test **passes, whatever it rendered**. It also rewrites
|
|
100
|
-
the file's header to `// Vitest Snapshot v1` and leaves Jest's entries in place as obsolete. A
|
|
101
|
-
plain local `jest` still passes, reports Vitest's entries as obsolete and puts its own header
|
|
102
|
-
back; `jest --ci` refuses the file ("Outdated snapshot: No snapshot header found").
|
|
103
|
-
- In CI (`CI` set), it writes no new entries and every such test fails as `mismatched`. It still
|
|
104
|
-
rewrites the file's header, so a `jest --ci` run after it in the same checkout refuses the file
|
|
105
|
-
too.
|
|
106
|
-
|
|
107
|
-
So a first local run is not a comparison with Jest's snapshots, and `vitest -u` rewrites Jest's
|
|
108
|
-
files.
|
|
109
|
-
|
|
110
|
-
**Trees differ.** Under `engine: 'native'`, real React Native renders **real host component names**
|
|
111
|
-
(`RCTText`, `RCTView`, `RCTScrollView`) and the host props it computes, whereas
|
|
112
|
-
`@react-native/jest-preset` snapshots show mock names (`Text`, `View`). So even an entry whose key
|
|
113
|
-
matches usually differs.
|
|
114
|
-
|
|
115
|
-
While both runners run, give Vitest its own directory, so that neither rewrites the other's files:
|
|
116
|
-
|
|
117
|
-
```ts
|
|
118
|
-
// vitest.config.mts
|
|
119
|
-
import path from "node:path";
|
|
120
|
-
|
|
121
|
-
export default defineConfig({
|
|
122
|
-
test: {
|
|
123
|
-
// Jest keeps __snapshots__/; Vitest writes __vitest_snapshots__/ beside it.
|
|
124
|
-
resolveSnapshotPath: (testPath, snapExtension) =>
|
|
125
|
-
path.join(
|
|
126
|
-
path.dirname(testPath),
|
|
127
|
-
"__vitest_snapshots__",
|
|
128
|
-
path.basename(testPath) + snapExtension,
|
|
129
|
-
),
|
|
130
|
-
},
|
|
131
|
-
});
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
Run `vitest run` once locally to record them, review the new files as you would any new snapshot,
|
|
135
|
-
and commit them. CI then checks against them, and Jest's own runs, `jest -u` included, leave them
|
|
136
|
-
alone. Once Jest is gone, either keep the setting and delete `__snapshots__/`, or delete Jest's
|
|
137
|
-
files, remove the setting and record again with `vitest run -u`.
|
|
138
|
-
|
|
139
|
-
> Tip: prefer explicit queries (`getByText`, `getByTestId`, `getByRole`) over large snapshots —
|
|
140
|
-
> they're robust across the engine's real host names and far easier to review.
|
|
141
|
-
|
|
142
|
-
### 2e. Drop `@react-native/jest-preset` and `transform`/`transformIgnorePatterns`
|
|
143
|
-
Those are Jest/Metro config. vitest-native handles RN + third-party transformation itself
|
|
144
|
-
(`engine: 'native'` transforms real RN in Node's loader hooks; the mock engine virtualizes RN).
|
|
145
|
-
For *run-real pure-JS* third-party libs under the native engine, use the plugin's `transform: [...]`
|
|
146
|
-
allowlist instead of `transformIgnorePatterns`.
|
|
147
|
-
|
|
148
|
-
One case needs a manual `transform` entry: a library shipping **untranspiled JSX in `.js` files**
|
|
149
|
-
(its `package.json` `"react-native"`/`"module"` field points at `src/`). Under the native engine
|
|
150
|
-
it's external to the Vite graph, so you'll see `Failed to parse source for import analysis … If you
|
|
151
|
-
are using JSX, make sure to name the file with the .jsx or .tsx extension. File: node_modules/<lib>/…`.
|
|
152
|
-
The error names the file — add that package: `reactNative({ engine: 'native', transform: ['<lib>'] })`.
|
|
153
|
-
Same entry is needed when a `vi.mock('<lib>')` must intercept an otherwise-externalized library.
|
|
154
|
-
|
|
155
|
-
### 2f. Jest config options
|
|
156
|
-
`jest.config.js` keys (`setupFilesAfterEnv`, `moduleNameMapper`, `testEnvironment`, etc.) move to the
|
|
157
|
-
Vitest config: `setupFiles`, `resolve.alias`, `test.environment: 'node'`. A suite on
|
|
158
|
-
`testEnvironment: 'jsdom'` keeps it as `test.environment: 'jsdom'` (`'happy-dom'` works too): React
|
|
159
|
-
Native renders there alongside the DOM, with either engine and with or without the hot runtime.
|
|
160
|
-
`jest.setTimeout(ms)` sets the timeout for the rest of the file, as in Jest (the shim maps it onto
|
|
161
|
-
`vi.setConfig({ testTimeout })`). Jest's `fakeTimers` config is not read. Pass its options to
|
|
162
|
-
`jest.useFakeTimers(...)` in the tests, which translates them (`advanceTimers`, `doNotFake`, `now`,
|
|
163
|
-
`timerLimit`); a `beforeEach(() => jest.useFakeTimers({ ... }))` in a setup file covers every test.
|
|
164
|
-
Or set them in Vitest's names under `test.fakeTimers` (`doNotFake` as `toFake`, `advanceTimers` as
|
|
165
|
-
`shouldAdvanceTime` and `advanceTimeDelta`). Don't call `jest.useFakeTimers(options)` at the top
|
|
166
|
-
level of a setup file: RNTL switches to real timers and back with
|
|
167
|
-
`jest.useFakeTimers({ legacyFakeTimers: false })` when it loads, and that drops the options. Unlike
|
|
168
|
-
Jest, `process.nextTick` and `queueMicrotask` stay real.
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
## 3. Known limits — assertions coupled to Jest's mocks
|
|
173
|
-
|
|
174
|
-
A minority of tests assert on **Jest's React Native mock internals** rather than rendered behavior.
|
|
175
|
-
The native engine runs *real* RN, so these can't be reproduced without re-mocking RN internally
|
|
176
|
-
(which defeats the point). Recognize them so you rewrite or skip rather than chase them. In our runs
|
|
177
|
-
they clustered in **component libraries** (which test RN internals directly); ordinary app suites hit
|
|
178
|
-
few or none.
|
|
179
|
-
|
|
180
|
-
- **`jest.spyOn(View.prototype, 'measure'/'measureInWindow')`** — Jest mocks `View` as a class with
|
|
181
|
-
prototype methods; real RN's `View` is a `forwardRef` with no such prototype, so the spy target is
|
|
182
|
-
`undefined`. Drive layout via `onLayout`/`fireEvent` instead, or accept as known-incompatible.
|
|
183
|
-
- **Factory-less `jest.mock('react-native/Libraries/…')` of internal submodules** (e.g.
|
|
184
|
-
`Appearance`, `AccessibilityInfo`) then spying them — Vitest builds a factory-less mock for
|
|
185
|
-
imports only, so externalized/resident RN's own require of the submodule isn't intercepted.
|
|
186
|
-
Prefer the public API from `react-native`. A submodule mock **with a factory** does reach React
|
|
187
|
-
Native under jest-compat (see the jest-compat guide's "One module registry per test file").
|
|
188
|
-
- **Finding nodes by host type name** (`node.type === 'View'`, `findAllByType('Text')`) — Jest's
|
|
189
|
-
preset mocks `View` and `Text` as host elements named `'View'` and `'Text'`. Real RN renders its
|
|
190
|
-
native host components: `RCTView` for `View`, `RCTText` for `Text` (`RCTVirtualText` when nested
|
|
191
|
-
in another `Text`), so a lookup by the mock's name finds nothing. The mock engine keeps the
|
|
192
|
-
`'View'`/`'Text'` names. Query by what the user sees instead (RNTL's `getByText`, `getByRole`,
|
|
193
|
-
`getByTestId` don't depend on host names), or match the real host names when a test must walk
|
|
194
|
-
the tree.
|
|
195
|
-
- **`image.props.source.uri` / raw `source`-shape assertions** — real RN normalizes `source`, so the
|
|
196
|
-
raw shape differs. Native = real RN = ground truth; assert on behavior instead.
|
|
197
|
-
- **`jest.mock('react-native', …)` nested inside `beforeAll`/`describe` callbacks** — Jest doesn't
|
|
198
|
-
hoist those (they're inert); vitest-native applies mocks more consistently, which can expose a mock
|
|
199
|
-
that was silently a no-op. Move it to top level with a valid override, or drop it.
|
|
200
|
-
|
|
201
|
-
The `jest.requireActual('react-native')` clone-and-override pattern is supported (RN's module is
|
|
202
|
-
writable under the compat layer). `jest.requireActual` and `jest.requireMock` also apply the
|
|
203
|
-
project's `resolve.alias` string entries, so a partial mock of `'@/services/api'` works the way
|
|
204
|
-
`babel-plugin-module-resolver` or jest-expo's path mapping made it work under Jest. Configure the
|
|
205
|
-
alias with a string `find` (`{ "@": path.resolve(__dirname, "src") }`). Outside a `jest.mock` factory's
|
|
206
|
-
own body (in a test, or in a function the factory returns), regex aliases and custom resolvers
|
|
207
|
-
cannot be applied to `requireActual`, and an unresolved specifier says so.
|
|
208
|
-
|
|
209
|
-
The partial-mock shape `jest.mock(p, () => ({ ...jest.requireActual(p), x: jest.fn() }))` of
|
|
210
|
-
your own source is loaded through Vite by `jestMockTransform()`, so the real members share module
|
|
211
|
-
state (a store, a cache) with the app code the test imports, and any alias Vite applies — regex
|
|
212
|
-
ones included — works there. This covers `requireActual` calls in the factory's own body; one
|
|
213
|
-
inside a function the factory returns, or a `require()` of the module that runs before any import,
|
|
214
|
-
still loads a separate copy through Node. **Coming from
|
|
215
|
-
jest-expo:** `migrate` translates its presets, and expo-router's own testing library runs as written —
|
|
216
|
-
see the [Expo guide](https://danfry1.github.io/vitest-native/guide/expo).
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
## 4. Suggested migration recipe
|
|
221
|
-
|
|
222
|
-
1. Add the jest-compat config (section 1). Upgrade RNTL to a supported 12–14 release (2b).
|
|
223
|
-
2. Delete manual third-party native-lib mocks and `@react-native/jest-preset` (2c, 2e).
|
|
224
|
-
3. Convert any **top-level** `jest.mock(...)` to `vi.mock(...)`; leave runtime `jest.*` as-is (2a).
|
|
225
|
-
4. Point Vitest's snapshots at their own directory and record them with one local `vitest run`
|
|
226
|
-
(2d), then run `vitest run` again to confirm green.
|
|
227
|
-
5. Triage remaining failures — a missing query update, a suite-specific mock, or a known
|
|
228
|
-
Jest-mock-coupled assertion (section 3). For runtime issues (large-suite memory limits,
|
|
229
|
-
error-boundary console noise, overriding a preset's mock), see the
|
|
230
|
-
[troubleshooting guide](https://danfry1.github.io/vitest-native/guide/troubleshooting).
|
|
231
|
-
|
|
232
|
-
## 5. What "done" looks like
|
|
233
|
-
|
|
234
|
-
A migrated suite runs under Vitest with: the jest-compat aliases + setup, RNTL 12–14, no manual
|
|
235
|
-
third-party native mocks, top-level mocks converted, and snapshots recorded by Vitest. You get Vitest's
|
|
236
|
-
speed/watch/UI while keeping `engine: 'native'` real-RN fidelity (or `engine: 'mock'` for the fast
|
|
237
|
-
path). The compat layer is intentionally small — it removes the mechanical Jest coupling so the only
|
|
238
|
-
work left is the genuinely suite-specific bits.
|
|
13
|
+
| Snapshots: "the resolveSnapshotPath recipe … section 2d" (`vitest-native compare`) | [Keep Jest's and Vitest's snapshots apart](https://danfry1.github.io/vitest-native/migration/from-jest#snapshots) |
|
|
14
|
+
| A package that "shipped source Node can't run directly" | [Drop jest-preset and transform config](https://danfry1.github.io/vitest-native/migration/from-jest#drop-jest-preset-and-transform-config) and [untranspiled packages](https://danfry1.github.io/vitest-native/guide/mocking#packages-that-ship-untranspiled-source) |
|
|
15
|
+
| `jest.<api>() has no Vitest equivalent` (`JEST_API_UNSUPPORTED`) | [`JEST_API_UNSUPPORTED`](https://danfry1.github.io/vitest-native/guide/errors#JEST_API_UNSUPPORTED) and the [jest-compat reference](https://danfry1.github.io/vitest-native/guide/jest-compat) |
|
|
@@ -27,9 +27,9 @@ npm i -D vitest-native @react-native/babel-preset @babel/core
|
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
Keep your existing `vitest`, `vite`, `react`, `react-native`, and
|
|
30
|
-
`@testing-library/react-native`. Requirements: **Vitest
|
|
31
|
-
version required by your RN release, React Native 0.
|
|
32
|
-
RNTL
|
|
30
|
+
`@testing-library/react-native`. Requirements: **Vitest 5.x, Vite ^8.0.5, the React
|
|
31
|
+
version required by your RN release, React Native 0.86–0.88, and
|
|
32
|
+
RNTL 13–14.** RNTL 14 uses async rendering APIs and requires a supported Node (22.22.3+, 24.12+ or 26+).
|
|
33
33
|
|
|
34
34
|
## 2. Update `vitest.config`
|
|
35
35
|
|
|
@@ -103,7 +103,7 @@ original plugin too:
|
|
|
103
103
|
that load through Node (not your Vite source graph) bypass Vitest's mocker.
|
|
104
104
|
Prefer a **preset** (if one exists) or mock at the boundary. Your *own* modules
|
|
105
105
|
mock normally.
|
|
106
|
-
- **Custom Babel plugins don't run.** Transforms go through Vite
|
|
106
|
+
- **Custom Babel plugins don't run.** Transforms go through Vite (Oxc), not your
|
|
107
107
|
`babel.config.js`. Flow/TS stripping for RN and allow-listed packages is handled
|
|
108
108
|
by the require hook; use the `transform` allowlist for extra pure-JS packages
|
|
109
109
|
that ship untranspiled source.
|
|
@@ -19,15 +19,14 @@ semver, which are experimental, and how the peer ranges below are allowed to mov
|
|
|
19
19
|
|
|
20
20
|
## Blocking compatibility matrix
|
|
21
21
|
|
|
22
|
-
- Node 22.
|
|
23
|
-
Linux.
|
|
24
|
-
-
|
|
25
|
-
- Vitest 5 (the lockfile release and the newest 5.x) against React Native 0.
|
|
26
|
-
|
|
27
|
-
- React Native 0.81–0.88 in the full native matrix (`.github/workflows/native-rn-matrix.yml`, the
|
|
22
|
+
- Node 22.22.3 (the floor) on Linux with RNTL 13 and 14, and on macOS and Windows; Node 24 and
|
|
23
|
+
Node 26 on Linux.
|
|
24
|
+
- Vite 8 (from the patched 8.0.5) through packed consumers.
|
|
25
|
+
- Vitest 5 (the lockfile release and the newest 5.x) against React Native 0.86–0.88.
|
|
26
|
+
- React Native 0.86–0.88 in the full native matrix (`.github/workflows/native-rn-matrix.yml`, the
|
|
28
27
|
source the published fidelity range is generated from).
|
|
29
28
|
- React Native 0.86 in a pinned packed Android consumer.
|
|
30
|
-
- React Native Testing Library
|
|
29
|
+
- React Native Testing Library 13 and 14.
|
|
31
30
|
- Expo SDK 58 and SDK 57, a hoisted npm-workspace monorepo, and a pnpm-workspace monorepo.
|
|
32
31
|
- jest-expo parity: the same probes under jest-expo and vitest-native in one Expo SDK 58 app, agreeing
|
|
33
32
|
except for listed differences.
|
|
@@ -44,7 +43,7 @@ versions are rejected rather than allowed to fail later inside private runner in
|
|
|
44
43
|
5. End-to-end memory-triggered worker recycling.
|
|
45
44
|
6. Hot runtime against the default engine: file-for-file parity over a generated app-shaped corpus,
|
|
46
45
|
and identical V8 and Istanbul coverage attribution.
|
|
47
|
-
7. Vitest semantics under the defaults
|
|
46
|
+
7. Vitest semantics under the defaults: config and CLI flags,
|
|
48
47
|
projects, watch mode, the jsdom and happy-dom environments, `--typecheck`, `vitest bench` and the
|
|
49
48
|
HTML (UI) reporter run as Vitest documents them, with cross-file isolation.
|
|
50
49
|
8. Mock-versus-real-RN behavioral cross-check.
|
|
@@ -84,15 +83,14 @@ change.
|
|
|
84
83
|
them; the caches every pull request starts from are the ones `main` saves. `pages.yml` also
|
|
85
84
|
publishes the fidelity matrix from the latest successful `main` run of the RN matrix.
|
|
86
85
|
|
|
87
|
-
The ATTW gate ignores legacy Node 10 resolution because the package requires Node 22.
|
|
86
|
+
The ATTW gate ignores legacy Node 10 resolution because the package requires Node 22.22.3+, 24.12+ or 26+.
|
|
88
87
|
|
|
89
88
|
Seven of the eleven `exports` subpaths are ESM-only by design — `.`, `./setup`, `./presets`, the
|
|
90
89
|
three `jest-compat` runtime shims, and the types-only `./rntl-matchers`. Each of the runtime ones
|
|
91
90
|
depends on Vitest, which throws when it is reached through `require()`, so shipping a transpiled
|
|
92
91
|
CommonJS build for them produced files that could not be loaded at all. They now declare a single
|
|
93
92
|
ESM target for both conditions: a CommonJS consumer still reaches them, through Node's `require(esm)`
|
|
94
|
-
support, which Node has
|
|
95
|
-
Node 24.0–24.2, where `jest.mock` does not reach modules Node loads.
|
|
93
|
+
support, which every supported Node has.
|
|
96
94
|
|
|
97
95
|
The remaining four subpaths ship a real CommonJS build and are checked with `cjs-resolves-to-esm`
|
|
98
96
|
enforced, so a dual entry cannot quietly lose its `.cjs`. Which subpaths are intentionally ESM-only
|
package/docs/versioning.md
CHANGED
|
@@ -24,7 +24,7 @@ and deep paths are not supported even when they happen to resolve.
|
|
|
24
24
|
| ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
25
25
|
| `vitest-native` | `reactNative`, `presets`, `disabledPresetNames` |
|
|
26
26
|
| `vitest-native/helpers` | `setPlatform`, `setDimensions`, `setColorScheme`, `setInsets`, `mockNativeModule`, `extendPresetMock`, `resetAllMocks` |
|
|
27
|
-
| `vitest-native/presets` | the 19 preset factories, by name
|
|
27
|
+
| `vitest-native/presets` | the 19 preset factories, by name |
|
|
28
28
|
| `vitest-native/matchers` | `toHaveAnimatedStyle`, `toHaveAnimatedProps`, `animatedMatchers` |
|
|
29
29
|
| `vitest-native/serializer` | `serializer` |
|
|
30
30
|
| `vitest-native/jest-compat` | `jestMockTransform`, `jestCompatAliases`, `jestCompatSetup` |
|
|
@@ -39,11 +39,12 @@ every subpath is loaded by specifier under both `require` and `import` in
|
|
|
39
39
|
### Plugin options
|
|
40
40
|
|
|
41
41
|
The keys accepted by the plugin function are `engine`, `platform`, `presets`, `mocks`,
|
|
42
|
-
`diagnostics`, `assetExts`, `metroConfig`, `transform`, `hotRuntime`, `nativeModules`. Their accepted types and
|
|
43
|
-
defaults are covered. An unknown key is rejected at configuration time, so adding a key is a minor
|
|
42
|
+
`diagnostics`, `assetExts`, `metroConfig`, `transform`, `hotRuntime`, `nativeModules`, `registryBuild`, `hangTimeout`, `ownership`, `experimental`, `projectBabel`. Their accepted types and
|
|
43
|
+
their defaults are covered. An unknown key is rejected at configuration time, so adding a key is a minor
|
|
44
44
|
and removing or renaming one is a major.
|
|
45
45
|
|
|
46
|
-
`hotRuntime` and `
|
|
46
|
+
`hotRuntime`, `metroConfig` and everything under `experimental` are exceptions — see
|
|
47
|
+
[Experimental](#experimental).
|
|
47
48
|
|
|
48
49
|
### Preset authoring
|
|
49
50
|
|
|
@@ -94,10 +95,12 @@ Changing any of these is a patch or minor, and never requires a major.
|
|
|
94
95
|
Experimental surfaces are excluded from the contract at every version, including after 1.0. They
|
|
95
96
|
are documented, tested, and gated in CI — they are simply not stable, and they say so.
|
|
96
97
|
|
|
97
|
-
| Surface
|
|
98
|
-
|
|
|
99
|
-
| `hotRuntime` and its options
|
|
100
|
-
| `metroConfig` and its options | Opt-in declarative Metro profile ingestion. Framework loading, custom resolvers and the version matrix remain under investigation. Off by default.
|
|
98
|
+
| Surface | Why |
|
|
99
|
+
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
100
|
+
| `hotRuntime` and its options | Built on Vitest's experimental custom-pool API, which can change between Vitest minors. The default is `false` (per-file isolation); `'auto'` opts in, and falls back to per-file isolation whenever the run cannot be bounded. |
|
|
101
|
+
| `metroConfig` and its options | Opt-in declarative Metro profile ingestion. Framework loading, custom resolvers and the version matrix remain under investigation. Off by default. |
|
|
102
|
+
| `experimental.nodeMocks` | Opt-in: a `vi.mock` applies to the modules Node loads too, as a `jest.mock` factory does under Jest. Each entry under `experimental` has a decision date in `src/flags.ts`, by which it becomes the default or is removed. Off by default. |
|
|
103
|
+
| `experimental.ownershipModel` | Opt-in shared resolution across Vite and Node's loaders (see [ownership model](ownership-model.md)). Each entry under `experimental` has a decision date in `src/flags.ts`, by which it becomes the default or is removed. Off by default. |
|
|
101
104
|
|
|
102
105
|
A surface leaves this list by being promoted in a minor, and can change or be removed in a minor
|
|
103
106
|
while it is on it.
|
|
@@ -114,7 +117,33 @@ handled explicitly:
|
|
|
114
117
|
release notes. The package does not promise to outlive its own dependencies.
|
|
115
118
|
- **Dropping a version upstream still supports** is a **major**.
|
|
116
119
|
- **Raising the Node floor** is a **minor** when the versions dropped are end-of-life, and a
|
|
117
|
-
**major** otherwise.
|
|
120
|
+
**major** otherwise. Raising it to a later patch or minor **within a Node line that stays
|
|
121
|
+
supported** is a **minor**: upstream ships fixes only in a line's newest release, and an
|
|
122
|
+
update within the same major is all it asks of a project.
|
|
123
|
+
|
|
124
|
+
### Support policy
|
|
125
|
+
|
|
126
|
+
What the package supports, and the rule for moving each range. The aim is a small, current set
|
|
127
|
+
that the engine can support without version-specific workarounds; a project on an older release
|
|
128
|
+
is asked to update rather than the engine carrying a second code path for it.
|
|
129
|
+
|
|
130
|
+
| Upstream | Supported | Rule |
|
|
131
|
+
| --- | --- | --- |
|
|
132
|
+
| Node | 22.22.3+ on Node 22, 24.12+ on Node 24, 26+ | Each line from the release where Node's in-thread module hooks (`module.registerHooks`) carry the engine. End-of-life lines (20, 23, 25) are not supported. Lines from 26 on are admitted, and are added to CI as they ship. |
|
|
133
|
+
| Vitest | 5.x | The current major only. A new major is added once it passes the full gate, and the previous one is dropped in the next breaking release. |
|
|
134
|
+
| Vite | 8.x, from 8.0.5 | The major Vitest's current release is built on. 8.0.5 is a security floor. |
|
|
135
|
+
| React Native | 0.86–0.88 (native engine) | The releases the CI matrix runs (`.github/rn-matrix.json`); 0.86 is Expo SDK 57's. A new release is added as it ships; the oldest is dropped in a breaking release. |
|
|
136
|
+
| Expo SDK | 57 and 58 | The SDKs CI installs as packed apps. |
|
|
137
|
+
| React Native Testing Library | 13.x and 14.x | The current and previous major. |
|
|
138
|
+
| React | 19 | The version React Native's supported releases use. |
|
|
139
|
+
|
|
140
|
+
On an unsupported Node the plugin stops at startup with `UNSUPPORTED_NODE`, for both engines, and
|
|
141
|
+
`vitest-native doctor` reports the same. Below a supported line's floor (22.x before 22.22.3, 24.x
|
|
142
|
+
before 24.12) an update within that major is enough; on another line the message names the
|
|
143
|
+
supported ones. A Vitest or Vite outside its range, a React older than 19, and under the native engine a
|
|
144
|
+
React Native older than 0.86, stop the plugin at startup with `UNSUPPORTED_PEER`, naming the
|
|
145
|
+
supported range and the version found. A React Native newer than the range, an Expo SDK outside
|
|
146
|
+
its range and an RNTL outside its range are warnings.
|
|
118
147
|
|
|
119
148
|
The currently supported ranges are in [Requirements](../README.md#requirements) and the blocking
|
|
120
149
|
matrix in [`release-readiness.md`](./release-readiness.md#blocking-compatibility-matrix). Those are
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitest-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0-rc.2",
|
|
4
4
|
"description": "Run real React Native tests under Vitest. One install, zero config.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"expo",
|
|
@@ -118,27 +118,43 @@
|
|
|
118
118
|
},
|
|
119
119
|
"scripts": {
|
|
120
120
|
"build": "bunx --bun tsdown && node scripts/copy-static-types.mjs",
|
|
121
|
-
"test": "vitest run",
|
|
122
|
-
"test:
|
|
123
|
-
"test:native
|
|
124
|
-
"test:native:
|
|
125
|
-
"test:native:
|
|
126
|
-
"test:native:
|
|
127
|
-
"test:native:
|
|
128
|
-
"test:native:
|
|
129
|
-
"test:native:
|
|
130
|
-
"test:native:
|
|
131
|
-
"test:native:
|
|
132
|
-
"test:native:
|
|
133
|
-
"test:native:
|
|
134
|
-
"test:native:
|
|
135
|
-
"test:native:
|
|
136
|
-
"test:native:
|
|
137
|
-
"test:native:
|
|
138
|
-
"test:native:
|
|
139
|
-
"test:native:
|
|
121
|
+
"test": "node scripts/ci/vitest.mjs run",
|
|
122
|
+
"test:cli-compare-e2e": "node scripts/ci/vitest.mjs run --config vitest.e2e.config.ts",
|
|
123
|
+
"test:native": "node scripts/run-scripts.mjs test:native:no-globals test:native:main test:native:per-file test:native:rntl-timers test:native:one-instance test:native:context test:native:shared-root test:native:preset-modules test:native:permissive test:native:reanimated-fallback test:native:partial-mock-external test:native:tsconfig-paths test:native:regex-alias test:native:dispatch-alias test:native:jest-registry-node-mocks test:native:jest-compat-restore-mocks test:native:node-mocks test:native:ownership test:native:project-js-jsx test:native:jest-globals-require test:native:compile-error test:native:project-babel test:native:rn-deep-mock test:native:root-mocks",
|
|
124
|
+
"test:native:main": "node scripts/ci/vitest.mjs run --config tests-native/vitest.config.mts",
|
|
125
|
+
"test:native:root-mocks": "node scripts/test-root-mocks-registry.mjs && node scripts/ci/vitest.mjs run --config tests-native/vitest.root-mocks-projects.config.mts && node scripts/ci/vitest.mjs run --config tests-native/vitest.root-mocks.config.mts --mode user-setup",
|
|
126
|
+
"test:native:jest-globals-require": "node scripts/ci/vitest.mjs run --config tests-native/vitest.jest-globals-require.config.mts --mode native && node scripts/ci/vitest.mjs run --config tests-native/vitest.jest-globals-require.config.mts --mode mock",
|
|
127
|
+
"test:native:per-file": "node scripts/ci/vitest.mjs run --config tests-native/vitest.per-file.config.mts",
|
|
128
|
+
"test:native:background": "node scripts/ci/vitest.mjs run --config tests-native/vitest.background.config.mts",
|
|
129
|
+
"test:native:regex-alias": "node scripts/ci/vitest.mjs run --config tests-native/vitest.regex-alias.config.mts",
|
|
130
|
+
"test:native:dispatch-alias": "node scripts/ci/vitest.mjs run --config tests-native/vitest.dispatch-alias.config.mts",
|
|
131
|
+
"test:native:jest-compat-restore-mocks": "node scripts/ci/vitest.mjs run --config tests-native/vitest.jest-compat-restore-mocks.config.mts",
|
|
132
|
+
"test:native:jest-registry-node-mocks": "node scripts/ci/vitest.mjs run --config tests-native/vitest.jest-registry-node-mocks.config.mts",
|
|
133
|
+
"test:native:partial-mock-external": "node scripts/ci/vitest.mjs run --config tests-native/vitest.partial-mock-external.config.mts",
|
|
134
|
+
"test:native:tsconfig-paths": "node scripts/ci/vitest.mjs run --config tests-native/tsconfig-paths/vitest.config.mts",
|
|
135
|
+
"test:native:one-instance": "node scripts/ci/vitest.mjs run --config tests-native/vitest.one-instance.config.mts --mode stock && node scripts/ci/vitest.mjs run --config tests-native/vitest.one-instance.config.mts --mode hot && node scripts/ci/vitest.mjs run --config tests-native/vitest.one-instance.config.mts --mode early && node scripts/ci/vitest.mjs run --config tests-native/vitest.one-instance.config.mts --mode jest-compat",
|
|
136
|
+
"test:native:rntl-timers": "node scripts/ci/vitest.mjs run --config tests-native/vitest.rntl-timers.config.mts --mode stock && node scripts/ci/vitest.mjs run --config tests-native/vitest.rntl-timers.config.mts --mode hot && node scripts/ci/vitest.mjs run --config tests-native/vitest.rntl-timers.config.mts --mode setup-stock && node scripts/ci/vitest.mjs run --config tests-native/vitest.rntl-timers.config.mts --mode setup-hot",
|
|
137
|
+
"test:native:ownership": "node scripts/ci/vitest.mjs run --config tests-native/vitest.ownership.config.mts --mode stock && node scripts/ci/vitest.mjs run --config tests-native/vitest.ownership.config.mts --mode hot && node scripts/ci/vitest.mjs run --config tests-native/vitest.ownership.config.mts --mode shadow && node scripts/ci/vitest.mjs run --config tests-native/vitest.ownership.config.mts --mode resolution && node scripts/ci/vitest.mjs run --config tests-native/vitest.ownership.config.mts --mode resolution-hot && node scripts/ci/vitest.mjs run --config tests-native/vitest.regex-alias.config.mts --mode ownership && node scripts/test-ownership-control.mjs && node scripts/test-ownership-registry-reuse.mjs",
|
|
138
|
+
"test:native:context": "node scripts/ci/vitest.mjs run --config tests-native/vitest.context.config.mts && node --conditions=vn-probe scripts/ci/vitest.mjs run --config tests-native/vitest.context.config.mts --project threads",
|
|
139
|
+
"test:native:no-globals": "node scripts/ci/vitest.mjs run --config tests-native/vitest.no-globals.config.mts --mode native && node scripts/ci/vitest.mjs run --config tests-native/vitest.no-globals.config.mts --mode hot && node scripts/ci/vitest.mjs run --config tests-native/vitest.no-globals.config.mts --mode noiso && node scripts/ci/vitest.mjs run --config tests-native/vitest.no-globals.config.mts --mode mock-noiso && node scripts/ci/vitest.mjs run --config tests-native/vitest.no-globals.config.mts --mode noiso-fakes-setup && node scripts/ci/vitest.mjs run --config tests-native/vitest.no-globals.config.mts --mode noiso-fakes-leak && node scripts/ci/vitest.mjs run --config tests-native/vitest.no-globals.config.mts --mode mock-noiso-fakes-setup && node scripts/ci/vitest.mjs run --config tests-native/vitest.no-globals.config.mts --mode mock-noiso-fakes-leak",
|
|
140
|
+
"test:native:node-mocks": "node scripts/ci/vitest.mjs run --config tests-native/vitest.node-mocks.config.mts --mode stock && node scripts/ci/vitest.mjs run --config tests-native/vitest.node-mocks.config.mts --mode hot && node scripts/ci/vitest.mjs run --config tests-native/vitest.node-mocks.config.mts --mode jest-compat",
|
|
141
|
+
"test:native:shared-root": "node scripts/ci/vitest.mjs run --config tests-native/vitest.shared-root.config.mts --mode stock && node scripts/ci/vitest.mjs run --config tests-native/vitest.shared-root.config.mts --mode hot && node scripts/ci/vitest.mjs run --config tests-native/vitest.shared-root-extends.config.mts",
|
|
142
|
+
"test:native:reanimated-fallback": "node scripts/ci/vitest.mjs run --config tests-native/vitest.reanimated-fallback.config.mts --mode native && node scripts/ci/vitest.mjs run --config tests-native/vitest.reanimated-fallback.config.mts --mode hot",
|
|
143
|
+
"test:native:preset-modules": "node scripts/ci/vitest.mjs run --config tests-native/vitest.custom-preset.config.mts --mode native && node scripts/ci/vitest.mjs run --config tests-native/vitest.custom-preset.config.mts --mode hot && node scripts/ci/vitest.mjs run --config tests-native/vitest.custom-preset.config.mts --mode mock",
|
|
144
|
+
"test:native:permissive": "node scripts/ci/vitest.mjs run --config tests-native/vitest.permissive.config.mts --mode stock && node scripts/ci/vitest.mjs run --config tests-native/vitest.permissive.config.mts --mode hot",
|
|
145
|
+
"test:native:project-js-jsx": "node scripts/ci/vitest.mjs run --config tests-native/vitest.project-js-jsx.config.mts --mode native && node scripts/ci/vitest.mjs run --config tests-native/vitest.project-js-jsx.config.mts --mode hot && node scripts/ci/vitest.mjs run --config tests-native/vitest.project-js-jsx.config.mts --mode mock && node scripts/ci/vitest.mjs run --config tests-native/vitest.project-js-jsx.config.mts --mode projects",
|
|
146
|
+
"test:native:rn-deep-mock": "node scripts/ci/vitest.mjs run --config tests-native/vitest.rn-deep-mock.config.mts --mode stock && node scripts/ci/vitest.mjs run --config tests-native/vitest.rn-deep-mock.config.mts --mode hot && node scripts/ci/vitest.mjs run --config tests-native/vitest.rn-deep-mock.config.mts --mode node-mocks",
|
|
147
|
+
"test:native:project-babel": "node scripts/test-project-babel.mjs",
|
|
148
|
+
"test:native:compile-error": "node scripts/test-compile-error-location.mjs",
|
|
149
|
+
"test:native:forks": "node scripts/ci/vitest.mjs run --config tests-native/vitest.forks.config.mts",
|
|
150
|
+
"test:native:navigation": "node scripts/ci/vitest.mjs run --config tests-native/vitest.navigation.config.mts && node scripts/ci/vitest.mjs run --config tests-native/vitest.native-stack.config.mts",
|
|
151
|
+
"test:native:android": "node scripts/ci/vitest.mjs run --config tests-native/vitest.android.config.mts",
|
|
152
|
+
"test:native:advice": "node scripts/ci/vitest.mjs run --config tests-native/vitest.advice.config.mts",
|
|
153
|
+
"test:native:hot": "node scripts/ci/vitest.mjs run --config tests-native/vitest.hot.config.mts",
|
|
154
|
+
"test:native:hot:isolation": "node scripts/ci/vitest.mjs run --config tests-native/vitest.hot-isolation.config.mts && node scripts/ci/vitest.mjs run --config tests-native/vitest.hot-user-setup.config.mts && node scripts/ci/vitest.mjs run --config tests-native/vitest.hot-jest-compat.config.mts --mode stock && node scripts/ci/vitest.mjs run --config tests-native/vitest.hot-jest-compat.config.mts --mode hot && node scripts/ci/vitest.mjs run --config tests-native/vitest.jest-registry-no-isolate.config.mts && bun run test:native:hot:file-accounting && bun run test:native:hot:act-scope && bun run test:native:hot:rntl-optout && bun run test:native:hot:compile-cache && bun run test:native:hot:workspace-member && bun run test:native:hot:memory && bun run test:native:hot:generation-parity",
|
|
140
155
|
"test:native:hot:file-accounting": "node scripts/test-hot-file-accounting.mjs",
|
|
141
156
|
"test:native:hot:act-scope": "node scripts/test-hot-act-scope.mjs",
|
|
157
|
+
"test:native:hot:rntl-optout": "node scripts/ci/vitest.mjs run --config tests-native/vitest.hot-rntl-optout.config.mts --maxWorkers 1 && node scripts/ci/vitest.mjs run --config tests-native/vitest.hot-rntl-optout.config.mts --maxWorkers 2",
|
|
142
158
|
"test:native:hot:compile-cache": "node scripts/test-hot-compile-cache.mjs",
|
|
143
159
|
"test:native:hot:workspace-member": "node scripts/test-hot-workspace-member.mjs",
|
|
144
160
|
"test:native:coverage": "node scripts/test-coverage-native.mjs",
|
|
@@ -148,9 +164,9 @@
|
|
|
148
164
|
"test:native:hot:memory": "node scripts/test-hot-memory.mjs",
|
|
149
165
|
"test:native:hot:generation-parity": "node scripts/test-hot-generation-parity.mjs",
|
|
150
166
|
"test:consumers": "node scripts/test-consumers.mjs",
|
|
151
|
-
"lint": "oxlint --deny-warnings src/ tests/ tests-native/ crosscheck/ consumer-tests/ scripts/",
|
|
152
|
-
"format": "oxfmt --write src/ tests/ consumer-tests/ scripts/",
|
|
153
|
-
"format:check": "oxfmt --check src/ tests/ consumer-tests/ scripts/",
|
|
167
|
+
"lint": "oxlint --deny-warnings src/ tests/ tests-native/ crosscheck/ consumer-tests/ scripts/ lint/",
|
|
168
|
+
"format": "oxfmt --write src/ tests/ consumer-tests/ scripts/ lint/",
|
|
169
|
+
"format:check": "oxfmt --check src/ tests/ consumer-tests/ scripts/ lint/",
|
|
154
170
|
"check-compat": "bun scripts/check-compat.ts",
|
|
155
171
|
"check:size": "node scripts/check-package-size.mjs",
|
|
156
172
|
"check:structure": "node scripts/structural-scorecard.mjs",
|
|
@@ -170,7 +186,7 @@
|
|
|
170
186
|
},
|
|
171
187
|
"dependencies": {
|
|
172
188
|
"flow-remove-types": "^2.337.0",
|
|
173
|
-
"magic-string": "^1.4.
|
|
189
|
+
"magic-string": "^1.4.5"
|
|
174
190
|
},
|
|
175
191
|
"devDependencies": {
|
|
176
192
|
"@babel/core": "^7.29.7",
|
|
@@ -187,8 +203,12 @@
|
|
|
187
203
|
"@types/node": "25.9.9",
|
|
188
204
|
"@types/react": "19.3.0",
|
|
189
205
|
"@vitest/coverage-v8": "5.0.5",
|
|
190
|
-
"
|
|
191
|
-
"
|
|
206
|
+
"dispatch-cycle-lib": "file:./tests-native/fixtures/dispatch-cycle-lib",
|
|
207
|
+
"dispatch-redirect-lib": "file:./tests-native/fixtures/dispatch-redirect-lib",
|
|
208
|
+
"dispatch-split-lib": "file:./tests-native/fixtures/dispatch-split-lib",
|
|
209
|
+
"dispatch-target-lib": "file:./tests-native/fixtures/dispatch-target-lib",
|
|
210
|
+
"expo": "58.0.21",
|
|
211
|
+
"expo-constants": "58.0.14",
|
|
192
212
|
"expo-status-bar": "58.0.4",
|
|
193
213
|
"ext-platform-lib": "file:./tests-native/fixtures/ext-platform-lib",
|
|
194
214
|
"ext-rn-named-lib": "file:./tests-native/fixtures/ext-rn-named-lib",
|
|
@@ -213,20 +233,26 @@
|
|
|
213
233
|
"rn-platform-flow-lib": "file:./tests-native/fixtures/rn-platform-flow-lib",
|
|
214
234
|
"rn-singleton-lib": "file:./tests-native/fixtures/rn-singleton-lib",
|
|
215
235
|
"test-renderer": "^1.3.1",
|
|
216
|
-
"tsdown": "0.23.
|
|
236
|
+
"tsdown": "0.23.4",
|
|
217
237
|
"typescript": "7.0.2",
|
|
218
238
|
"typescript-6": "npm:typescript@6.0.3",
|
|
219
239
|
"untranspiled-jsx-lib": "file:./tests-native/fixtures/untranspiled-jsx-lib",
|
|
220
240
|
"vite": "^8.3.5",
|
|
221
|
-
"vitest": "5.0.5"
|
|
241
|
+
"vitest": "5.0.5",
|
|
242
|
+
"vn-lib-esm-support": "file:./tests-native/fixtures/vn-lib-esm-support",
|
|
243
|
+
"vn-lib-jest-support": "file:./tests-native/fixtures/vn-lib-jest-support",
|
|
244
|
+
"vn-lib-own-mock": "file:./tests-native/fixtures/vn-lib-own-mock",
|
|
245
|
+
"vn-lib-plain-mock": "file:./tests-native/fixtures/vn-lib-plain-mock",
|
|
246
|
+
"vn-lib-plain-two-entries": "file:./tests-native/fixtures/vn-lib-plain-two-entries",
|
|
247
|
+
"vn-lib-two-entries": "file:./tests-native/fixtures/vn-lib-two-entries"
|
|
222
248
|
},
|
|
223
249
|
"peerDependencies": {
|
|
224
250
|
"@babel/core": "*",
|
|
225
251
|
"@react-native/babel-preset": "*",
|
|
226
|
-
"@testing-library/react-native": ">=
|
|
227
|
-
"react": ">=
|
|
228
|
-
"vite": "^
|
|
229
|
-
"vitest": ">=
|
|
252
|
+
"@testing-library/react-native": ">=13 <15",
|
|
253
|
+
"react": ">=19",
|
|
254
|
+
"vite": "^8.0.5",
|
|
255
|
+
"vitest": ">=5 <6"
|
|
230
256
|
},
|
|
231
257
|
"peerDependenciesMeta": {
|
|
232
258
|
"@testing-library/react-native": {
|
|
@@ -240,6 +266,6 @@
|
|
|
240
266
|
}
|
|
241
267
|
},
|
|
242
268
|
"engines": {
|
|
243
|
-
"node": ">=22.
|
|
269
|
+
"node": ">=22.22.3 <23 || >=24.12.0 <25 || >=26.0.0"
|
|
244
270
|
}
|
|
245
271
|
}
|