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.
Files changed (43) hide show
  1. package/README.md +14 -14
  2. package/dist/cli.mjs +821 -16
  3. package/dist/context.d.mts +1 -0
  4. package/dist/context.mjs +1 -0
  5. package/dist/docs-url.mjs +1 -1
  6. package/dist/hang-watch.d.mts +2 -0
  7. package/dist/hang-watch.mjs +41 -6
  8. package/dist/{host-D0r3P_T1.mjs → host-C02lnLzW.mjs} +206 -147
  9. package/dist/{index-JOR602XU.d.mts → index-BpZ0E2eJ.d.mts} +14 -4
  10. package/dist/index.d.mts +1 -1
  11. package/dist/index.mjs +54 -20
  12. package/dist/jest-compat/node-registry.mjs +15 -0
  13. package/dist/jest-compat.cjs +53 -6
  14. package/dist/jest-compat.mjs +54 -6
  15. package/dist/native/babel-toolchain.mjs +3 -1
  16. package/dist/native/bounded-process.mjs +16 -3
  17. package/dist/native/bridge.mjs +11 -6
  18. package/dist/native/compiler-watchdog.mjs +18 -0
  19. package/dist/native/hooks.mjs +16 -3
  20. package/dist/native/module-reset.mjs +29 -7
  21. package/dist/native/native-modules.mjs +2 -0
  22. package/dist/native/ownership-ledger.d.mts +3 -0
  23. package/dist/native/ownership-ledger.mjs +53 -15
  24. package/dist/native/ownership.d.mts +1 -0
  25. package/dist/native/ownership.mjs +48 -16
  26. package/dist/native/registry-compiler.mjs +6 -15
  27. package/dist/native/registry-process.mjs +16 -0
  28. package/dist/native/reset.mjs +29 -3
  29. package/dist/native/resident-health.mjs +4 -0
  30. package/dist/native/root-spelling.d.mts +2 -0
  31. package/dist/native/root-spelling.mjs +12 -6
  32. package/dist/native/runner.mjs +1 -1
  33. package/dist/native/suspension.mjs +57 -0
  34. package/dist/native/worker.mjs +14 -6
  35. package/dist/{presets-_EaSw29m.mjs → presets-D_-kRSYm.mjs} +125 -79
  36. package/dist/presets.d.mts +1 -1
  37. package/dist/presets.mjs +1 -1
  38. package/dist/{root-mocks-BNXeosbR.mjs → root-mocks-DP95ncxD.mjs} +1 -1
  39. package/dist/setup.mjs +1 -1
  40. package/docs/migrating-from-jest.md +4 -4
  41. package/docs/release-readiness.md +3 -2
  42. package/docs/versioning.md +1 -1
  43. package/package.json +15 -7
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/vitest-native)](https://www.npmjs.com/package/vitest-native)
4
4
  [![npm downloads](https://img.shields.io/npm/dm/vitest-native)](https://npmcharts.com/compare/vitest-native?interval=30)
5
- [![RN fidelity](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fdanfry1%2Fvitest-native%2Fmain%2Fpackages%2Fvitest-native%2Fcrosscheck%2Ffidelity-badge.json)](https://danfry1.github.io/vitest-native/guide/fidelity)
5
+ [![RN fidelity](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fdanfry1%2Fvitest-native%2Fmain%2Fpackages%2Fvitest-native%2Fcrosscheck%2Ffidelity-badge.json)](https://vitest-native.danfry.dev/guide/fidelity)
6
6
  [![license](https://img.shields.io/npm/l/vitest-native)](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: [danfry1.github.io/vitest-native](https://danfry1.github.io/vitest-native/)**
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://danfry1.github.io/vitest-native/guide/comparison) and
30
- [choosing an engine](https://danfry1.github.io/vitest-native/guide/engines).
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://danfry1.github.io/vitest-native/guide/fidelity) lists every probe.
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://danfry1.github.io/vitest-native/guide/validation-model).
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://danfry1.github.io/vitest-native/migration/from-jest) and the
101
- [Expo guide](https://danfry1.github.io/vitest-native/guide/expo).
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://danfry1.github.io/vitest-native/guide/engines) and the [hot runtime](https://danfry1.github.io/vitest-native/guide/hot-runtime)
122
- - [Third-party presets](https://danfry1.github.io/vitest-native/guide/presets) (Reanimated, Gesture Handler, Navigation, …)
123
- - [Expo](https://danfry1.github.io/vitest-native/guide/expo) · [Plugin options](https://danfry1.github.io/vitest-native/guide/plugin-options) · [Test helpers](https://danfry1.github.io/vitest-native/guide/helpers)
124
- - [Coverage](https://danfry1.github.io/vitest-native/guide/coverage) · [CLI](https://danfry1.github.io/vitest-native/guide/cli) · [Troubleshooting](https://danfry1.github.io/vitest-native/guide/troubleshooting)
125
- - [Release notes for 0.14](https://danfry1.github.io/vitest-native/releases/0.14) · [Changelog](https://github.com/danfry1/vitest-native/blob/main/packages/vitest-native/CHANGELOG.md)
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://danfry1.github.io/vitest-native/migration/from-vitest-react-native).
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