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.
- package/README.md +11 -10
- package/dist/cli.d.mts +9 -1
- package/dist/cli.mjs +2497 -270
- package/dist/context.d.mts +15 -0
- package/dist/context.mjs +39 -1
- package/dist/errors.d.mts +20 -1
- package/dist/helpers.cjs +22 -1
- package/dist/helpers.mjs +22 -1
- package/dist/{host-BAAAlSkO.mjs → host-BAMNg80P.mjs} +178 -101
- package/dist/{index-aNBCTfA5.d.mts → index-CrCsGULN.d.mts} +76 -2
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +624 -145
- package/dist/jest-compat/interop.mjs +1 -1
- package/dist/jest-compat/jest-object.mjs +3 -4
- package/dist/jest-compat/node-registry.mjs +791 -67
- package/dist/jest-compat/setup.mjs +4 -4
- package/dist/matchers.d.cts +0 -1
- package/dist/matchers.d.mts +0 -1
- 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/explain.mjs +1 -2
- package/dist/native/export-condition-recovery.mjs +20 -99
- package/dist/native/hooks.mjs +252 -127
- package/dist/native/jest-resolvers.mjs +94 -0
- package/dist/native/library-jest.mjs +346 -0
- package/dist/native/loader.mjs +155 -67
- package/dist/native/match.mjs +30 -1
- package/dist/native/module-reset.mjs +44 -49
- package/dist/native/ownership-ledger.d.mts +77 -0
- package/dist/native/ownership-ledger.mjs +467 -0
- package/dist/native/ownership.d.mts +5 -0
- package/dist/native/ownership.mjs +30 -0
- package/dist/native/registry-compiler.mjs +39 -5
- package/dist/native/registry-process.mjs +327 -28
- package/dist/native/registry.mjs +750 -200
- package/dist/native/resolve.mjs +91 -4
- package/dist/native/rntl-hooks.mjs +8 -5
- package/dist/native/rntl-text-host.mjs +5 -15
- package/dist/native/setup.mjs +117 -36
- package/dist/native/shared-resolver.d.mts +141 -0
- package/dist/native/shared-resolver.mjs +719 -0
- package/dist/native/transform.mjs +4 -5
- package/dist/native/worker.mjs +9 -4
- package/dist/node-dispatch.mjs +291 -0
- package/dist/{preset-map-CogjYmSw.mjs → preset-map-DdAexIwz.mjs} +113 -2
- package/dist/{presets-CXDyg51l.mjs → presets-CsQynQ0A.mjs} +620 -78
- 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 +27 -13
- package/dist/setup.mjs +4 -4
- 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 +33 -13
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# vitest-native
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/vitest-native)
|
|
4
|
+
[](https://npmcharts.com/compare/vitest-native?interval=30)
|
|
4
5
|
[](https://danfry1.github.io/vitest-native/guide/fidelity)
|
|
5
6
|
[](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.
|
|
107
|
-
| Vitest |
|
|
108
|
-
| Vite | ^
|
|
109
|
-
| React |
|
|
110
|
-
| React Native | 0.
|
|
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 |
|
|
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
|
|
116
|
-
|
|
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/
|
|
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
|
|
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
|
-
|
|
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>;
|