vitest-native 0.15.0-rc.2 → 0.15.0-rc.3
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 +14 -14
- package/dist/cli.mjs +821 -16
- package/dist/context.d.mts +1 -0
- package/dist/context.mjs +1 -0
- package/dist/docs-url.mjs +1 -1
- package/dist/hang-watch.d.mts +2 -0
- package/dist/hang-watch.mjs +41 -6
- package/dist/{host-D0r3P_T1.mjs → host-C02lnLzW.mjs} +206 -147
- package/dist/{index-JOR602XU.d.mts → index-BpZ0E2eJ.d.mts} +14 -4
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +54 -20
- package/dist/jest-compat/node-registry.mjs +15 -0
- package/dist/jest-compat.cjs +53 -6
- package/dist/jest-compat.mjs +54 -6
- package/dist/native/babel-toolchain.mjs +3 -1
- package/dist/native/bounded-process.mjs +16 -3
- package/dist/native/bridge.mjs +11 -6
- package/dist/native/compiler-watchdog.mjs +18 -0
- package/dist/native/hooks.mjs +16 -3
- package/dist/native/module-reset.mjs +29 -7
- package/dist/native/native-modules.mjs +2 -0
- package/dist/native/ownership-ledger.d.mts +3 -0
- package/dist/native/ownership-ledger.mjs +53 -15
- package/dist/native/ownership.d.mts +1 -0
- package/dist/native/ownership.mjs +48 -16
- package/dist/native/registry-compiler.mjs +6 -15
- package/dist/native/registry-process.mjs +16 -0
- package/dist/native/reset.mjs +29 -3
- package/dist/native/resident-health.mjs +4 -0
- package/dist/native/root-spelling.d.mts +2 -0
- package/dist/native/root-spelling.mjs +12 -6
- package/dist/native/runner.mjs +1 -1
- package/dist/native/suspension.mjs +57 -0
- package/dist/native/worker.mjs +14 -6
- package/dist/{presets-_EaSw29m.mjs → presets-D_-kRSYm.mjs} +125 -79
- package/dist/presets.d.mts +1 -1
- package/dist/presets.mjs +1 -1
- package/dist/{root-mocks-BNXeosbR.mjs → root-mocks-DP95ncxD.mjs} +1 -1
- package/dist/setup.mjs +1 -1
- package/docs/migrating-from-jest.md +4 -4
- package/docs/release-readiness.md +3 -2
- package/docs/versioning.md +1 -1
- package/package.json +15 -7
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/vitest-native)
|
|
4
4
|
[](https://npmcharts.com/compare/vitest-native?interval=30)
|
|
5
|
-
[](https://
|
|
5
|
+
[](https://vitest-native.danfry.dev/guide/fidelity)
|
|
6
6
|
[](https://github.com/danfry1/vitest-native/blob/main/LICENSE)
|
|
7
7
|
|
|
8
8
|
**Test React Native with Vitest, against real React Native.**
|
|
@@ -11,7 +11,7 @@ vitest-native is a Vitest plugin. Your tests run React Native's real JavaScript,
|
|
|
11
11
|
that ships in your app, and only the native modules and native host components are mocked.
|
|
12
12
|
It works the same for bare React Native and Expo apps.
|
|
13
13
|
|
|
14
|
-
**📖 Documentation: [
|
|
14
|
+
**📖 Documentation: [vitest-native.danfry.dev](https://vitest-native.danfry.dev/)**
|
|
15
15
|
|
|
16
16
|
## Why not Jest's preset?
|
|
17
17
|
|
|
@@ -26,8 +26,8 @@ mock boundary sits lower, so your tests run React Native's real component code.
|
|
|
26
26
|
| Rendered host names | `View`, `Text` | `RCTView`, `RCTText` |
|
|
27
27
|
|
|
28
28
|
A lightweight pure-JS mock engine is also available (`engine: 'mock'`) for tests that need no React
|
|
29
|
-
Native at all. See the [comparison with Jest](https://
|
|
30
|
-
[choosing an engine](https://
|
|
29
|
+
Native at all. See the [comparison with Jest](https://vitest-native.danfry.dev/guide/comparison) and
|
|
30
|
+
[choosing an engine](https://vitest-native.danfry.dev/guide/engines).
|
|
31
31
|
|
|
32
32
|
## Who it's for
|
|
33
33
|
|
|
@@ -43,13 +43,13 @@ Migrating a large Jest suite is incremental, not turnkey.
|
|
|
43
43
|
|
|
44
44
|
- **Behavioral cross-check.** The same probes run under the mock engine and under real React
|
|
45
45
|
Native, across every React Native version CI supports, and any difference fails the build. The
|
|
46
|
-
badge above shows the current count; the [fidelity report](https://
|
|
46
|
+
badge above shows the current count; the [fidelity report](https://vitest-native.danfry.dev/guide/fidelity) lists every probe.
|
|
47
47
|
- **Packed consumers in CI.** The release tarball is installed into bare React Native, Expo SDK 57
|
|
48
48
|
and 58 apps (with expo-router), and npm and pnpm workspace monorepos, and their tests run in CI.
|
|
49
49
|
- **Real apps, as observations.** Public apps are run in the
|
|
50
50
|
[bake-offs repository](https://github.com/danfry1/vitest-native-bakeoffs), with each app's setup
|
|
51
51
|
in the repository. Their results are not capability claims; see the
|
|
52
|
-
[validation model](https://
|
|
52
|
+
[validation model](https://vitest-native.danfry.dev/guide/validation-model).
|
|
53
53
|
- **Performance.** vitest-native is not a speed play. Each test file gets a fresh worker by
|
|
54
54
|
default; the opt-in hot runtime reuses workers, and whether that is faster depends on your suite,
|
|
55
55
|
so measure it.
|
|
@@ -97,8 +97,8 @@ Run it with `npx vitest`, or add `"test": "vitest"` to your scripts. If somethin
|
|
|
97
97
|
|
|
98
98
|
`npx vitest-native migrate` reads your Jest config and reports what maps over; `--write` saves the
|
|
99
99
|
suggested Vitest config. Existing `jest.fn`, `jest.mock` and `jest.useFakeTimers` calls keep working
|
|
100
|
-
through the jest-compat layer. See [migrating from Jest](https://
|
|
101
|
-
[Expo guide](https://
|
|
100
|
+
through the jest-compat layer. See [migrating from Jest](https://vitest-native.danfry.dev/migration/from-jest) and the
|
|
101
|
+
[Expo guide](https://vitest-native.danfry.dev/guide/expo).
|
|
102
102
|
|
|
103
103
|
## Requirements
|
|
104
104
|
|
|
@@ -118,11 +118,11 @@ module hooks work; on an older Node the plugin stops at startup with `UNSUPPORTE
|
|
|
118
118
|
|
|
119
119
|
## Learn more
|
|
120
120
|
|
|
121
|
-
- [Choosing an engine](https://
|
|
122
|
-
- [Third-party presets](https://
|
|
123
|
-
- [Expo](https://
|
|
124
|
-
- [Coverage](https://
|
|
125
|
-
- [Release notes for 0.14](https://
|
|
121
|
+
- [Choosing an engine](https://vitest-native.danfry.dev/guide/engines) and the [hot runtime](https://vitest-native.danfry.dev/guide/hot-runtime)
|
|
122
|
+
- [Third-party presets](https://vitest-native.danfry.dev/guide/presets) (Reanimated, Gesture Handler, Navigation, …)
|
|
123
|
+
- [Expo](https://vitest-native.danfry.dev/guide/expo) · [Plugin options](https://vitest-native.danfry.dev/guide/plugin-options) · [Test helpers](https://vitest-native.danfry.dev/guide/helpers)
|
|
124
|
+
- [Coverage](https://vitest-native.danfry.dev/guide/coverage) · [CLI](https://vitest-native.danfry.dev/guide/cli) · [Troubleshooting](https://vitest-native.danfry.dev/guide/troubleshooting)
|
|
125
|
+
- [Release notes for 0.14](https://vitest-native.danfry.dev/releases/0.14) · [Changelog](https://github.com/danfry1/vitest-native/blob/main/packages/vitest-native/CHANGELOG.md)
|
|
126
126
|
|
|
127
127
|
## Status
|
|
128
128
|
|
|
@@ -130,7 +130,7 @@ Beta. What is covered by semver, what is experimental and what 1.0 will mean are
|
|
|
130
130
|
[versioning and stability](https://github.com/danfry1/vitest-native/blob/main/packages/vitest-native/docs/versioning.md).
|
|
131
131
|
vitest-native is the maintained successor to
|
|
132
132
|
[`vitest-community/vitest-react-native`](https://github.com/vitest-community/vitest-react-native),
|
|
133
|
-
rebuilt for Vitest 5; see [migrating from it](https://
|
|
133
|
+
rebuilt for Vitest 5; see [migrating from it](https://vitest-native.danfry.dev/migration/from-vitest-react-native).
|
|
134
134
|
|
|
135
135
|
## Contributing
|
|
136
136
|
|