vitest-native 0.14.1 → 0.15.0-rc.1

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 (59) hide show
  1. package/README.md +11 -10
  2. package/dist/cli.d.mts +9 -1
  3. package/dist/cli.mjs +2497 -270
  4. package/dist/context.d.mts +15 -0
  5. package/dist/context.mjs +39 -1
  6. package/dist/errors.d.mts +20 -1
  7. package/dist/helpers.cjs +22 -1
  8. package/dist/helpers.mjs +22 -1
  9. package/dist/{host-BAAAlSkO.mjs → host-BAMNg80P.mjs} +178 -101
  10. package/dist/{index-aNBCTfA5.d.mts → index-CrCsGULN.d.mts} +76 -2
  11. package/dist/index.d.mts +2 -1
  12. package/dist/index.mjs +624 -145
  13. package/dist/jest-compat/interop.mjs +1 -1
  14. package/dist/jest-compat/jest-object.mjs +3 -4
  15. package/dist/jest-compat/node-registry.mjs +791 -67
  16. package/dist/jest-compat/setup.mjs +4 -4
  17. package/dist/matchers.d.cts +0 -1
  18. package/dist/matchers.d.mts +0 -1
  19. package/dist/native/bounded-process.mjs +63 -5
  20. package/dist/native/bridge-client.mjs +133 -0
  21. package/dist/native/bridge-server.mjs +215 -0
  22. package/dist/native/bridge-thread.mjs +79 -0
  23. package/dist/native/bridge.mjs +512 -0
  24. package/dist/native/explain.mjs +1 -2
  25. package/dist/native/export-condition-recovery.mjs +20 -99
  26. package/dist/native/hooks.mjs +252 -127
  27. package/dist/native/jest-resolvers.mjs +94 -0
  28. package/dist/native/library-jest.mjs +346 -0
  29. package/dist/native/loader.mjs +155 -67
  30. package/dist/native/match.mjs +30 -1
  31. package/dist/native/module-reset.mjs +44 -49
  32. package/dist/native/ownership-ledger.d.mts +77 -0
  33. package/dist/native/ownership-ledger.mjs +467 -0
  34. package/dist/native/ownership.d.mts +5 -0
  35. package/dist/native/ownership.mjs +30 -0
  36. package/dist/native/registry-compiler.mjs +39 -5
  37. package/dist/native/registry-process.mjs +327 -28
  38. package/dist/native/registry.mjs +750 -200
  39. package/dist/native/resolve.mjs +91 -4
  40. package/dist/native/rntl-hooks.mjs +8 -5
  41. package/dist/native/rntl-text-host.mjs +5 -15
  42. package/dist/native/setup.mjs +117 -36
  43. package/dist/native/shared-resolver.d.mts +141 -0
  44. package/dist/native/shared-resolver.mjs +719 -0
  45. package/dist/native/transform.mjs +4 -5
  46. package/dist/native/worker.mjs +9 -4
  47. package/dist/node-dispatch.mjs +291 -0
  48. package/dist/{preset-map-CogjYmSw.mjs → preset-map-DdAexIwz.mjs} +113 -2
  49. package/dist/{presets-CXDyg51l.mjs → presets-CsQynQ0A.mjs} +620 -78
  50. package/dist/presets.d.mts +1 -1
  51. package/dist/presets.mjs +1 -1
  52. package/dist/rntl-matchers.d.ts +11 -15
  53. package/dist/rntl-support.mjs +27 -13
  54. package/dist/setup.mjs +4 -4
  55. package/docs/migrating-from-jest.md +9 -232
  56. package/docs/migrating-from-vitest-react-native.md +4 -4
  57. package/docs/release-readiness.md +9 -11
  58. package/docs/versioning.md +38 -9
  59. package/package.json +33 -13
package/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # vitest-native
2
2
 
3
3
  [![npm](https://img.shields.io/npm/v/vitest-native)](https://www.npmjs.com/package/vitest-native)
4
+ [![npm downloads](https://img.shields.io/npm/dm/vitest-native)](https://npmcharts.com/compare/vitest-native?interval=30)
4
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
6
  [![license](https://img.shields.io/npm/l/vitest-native)](https://github.com/danfry1/vitest-native/blob/main/LICENSE)
6
7
 
@@ -103,21 +104,21 @@ through the jest-compat layer. See [migrating from Jest](https://danfry1.github.
103
104
 
104
105
  | | Supported |
105
106
  |---|---|
106
- | Node.js | 22.13+ on Node 22, or 24.3+ |
107
- | Vitest | 4.x or 5.x |
108
- | Vite | ^6.4.2, ^7.3.2 or ^8.0.5 |
109
- | React | 18 or later |
110
- | React Native | 0.81–0.88 |
107
+ | Node.js | 22.22.3+ on Node 22, 24.12+ on Node 24, or 26+ |
108
+ | Vitest | 5.x |
109
+ | Vite | ^8.0.5 |
110
+ | React | 19 or later |
111
+ | React Native | 0.86–0.88 |
111
112
  | Expo SDK | 57 and 58 |
112
- | React Native Testing Library | 12.x, 13.x or 14.x (optional) |
113
+ | React Native Testing Library | 13.x or 14.x (optional) |
113
114
 
114
115
  Use the React version your React Native release requires, and a `@react-native/babel-preset`
115
- that matches its minor version. Node 24.0–24.2 are excluded because `jest.mock` does not reach
116
- modules Node loads there.
116
+ that matches its minor version. Each Node line starts at the release where Node's in-thread
117
+ module hooks work; on an older Node the plugin stops at startup with `UNSUPPORTED_NODE`.
117
118
 
118
119
  ## Learn more
119
120
 
120
- - [Choosing an engine](https://danfry1.github.io/vitest-native/guide/engines) and the [hot runtime](https://danfry1.github.io/vitest-native/guide/engines#hot-runtime)
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)
121
122
  - [Third-party presets](https://danfry1.github.io/vitest-native/guide/presets) (Reanimated, Gesture Handler, Navigation, …)
122
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)
123
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)
@@ -129,7 +130,7 @@ Beta. What is covered by semver, what is experimental and what 1.0 will mean are
129
130
  [versioning and stability](https://github.com/danfry1/vitest-native/blob/main/packages/vitest-native/docs/versioning.md).
130
131
  vitest-native is the maintained successor to
131
132
  [`vitest-community/vitest-react-native`](https://github.com/vitest-community/vitest-react-native),
132
- rebuilt for Vitest 4 and 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://danfry1.github.io/vitest-native/migration/from-vitest-react-native).
133
134
 
134
135
  ## Contributing
135
136
 
package/dist/cli.d.mts CHANGED
@@ -1 +1,9 @@
1
- export declare function main(argv: string[], log?: (line: string) => void): number;
1
+ /** Each command's flags, besides --root <dir> and --help, which every command takes. */
2
+ export declare const COMMAND_FLAGS: Record<string, string[]>;
3
+ /**
4
+ * The first flag `command` does not take, or null. An ignored typo (`--wirte`, `--stirct`)
5
+ * would run something other than what was asked, so it is refused instead. The argument
6
+ * after a valued flag is its value, even when it starts with "--" (`--jest-args "--ci"`).
7
+ */
8
+ export declare function unknownFlag(command: string, args: string[]): string | null;
9
+ export declare function main(argv: string[], log?: (line: string) => void): number | Promise<number>;