vitest-native 0.4.0 → 0.4.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 (3) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +16 -2
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # vitest-native
2
2
 
3
+ ## 0.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ Documentation fixes (the README is consumers' primary reference):
8
+
9
+ - **Quick Start now runs as written.** It used bare `test()`/`expect()` with no
10
+ import, but the plugin does not enable Vitest globals — copying it produced
11
+ `test is not defined`. Added the `import { test, expect } from 'vitest'` and a
12
+ note on the `globals: true` alternative.
13
+ - **Installation** notes the companion dependencies the examples need
14
+ (`@testing-library/react-native`; a real RN app already provides `react-native`
15
+ + `@react-native/babel-preset` + `@babel/core`).
16
+ - Corrected the RN-conformance count (118 ported: 115 passing, 3 documented skips).
17
+ - "Spiritual successor" → "Maintained successor" wording, with a migration link.
18
+
3
19
  ## 0.4.0
4
20
 
5
21
  **The native engine is now the zero-config default.** `reactNative()` with no
package/README.md CHANGED
@@ -4,7 +4,7 @@ Run your React Native tests under Vitest, against **real React Native** — the
4
4
 
5
5
  > **Beta.** The real-RN engine is validated against real apps (react-native-paper, the obytes template, Rocket.Chat) across React Native 0.81–0.84, with a CI-gated behavioral cross-check against real RN. Some APIs may still shift before 1.0.
6
6
  >
7
- > Spiritual successor to [`vitest-community/vitest-react-native`](https://github.com/vitest-community/vitest-react-native) — same core idea (externalize RN, run its real JS under Node), rebuilt for modern Vitest (4+).
7
+ > Maintained successor to [`vitest-community/vitest-react-native`](https://github.com/vitest-community/vitest-react-native) — same core idea (externalize RN, run its real JS under Node), rebuilt for modern Vitest (4+). Coming from it? See [Migrating from `vitest-react-native`](#migrating-from-vitest-react-native).
8
8
 
9
9
  ---
10
10
 
@@ -64,6 +64,16 @@ yarn add -D vitest-native
64
64
  pnpm add -D vitest-native
65
65
  ```
66
66
 
67
+ A real React Native project already provides what the native engine needs —
68
+ `react-native`, `@react-native/babel-preset`, and `@babel/core`. Add
69
+ `@testing-library/react-native` if you don't have it yet (the examples below use it):
70
+
71
+ ```bash
72
+ npm install -D @testing-library/react-native
73
+ ```
74
+
75
+ See [Requirements](#requirements) for exact versions.
76
+
67
77
  ---
68
78
 
69
79
  ## Quick Start
@@ -82,6 +92,7 @@ export default defineConfig({
82
92
  That is it. Write a test:
83
93
 
84
94
  ```tsx
95
+ import { test, expect } from 'vitest';
85
96
  import { render, screen } from '@testing-library/react-native';
86
97
  import { View, Text } from 'react-native';
87
98
 
@@ -99,6 +110,9 @@ test('renders a greeting', () => {
99
110
  });
100
111
  ```
101
112
 
113
+ > Prefer Jest-style globals (`test`/`expect` without imports)? Set
114
+ > `test: { globals: true }` in your Vitest config — vitest-native does not force it on.
115
+
102
116
  Run it:
103
117
 
104
118
  ```bash
@@ -241,7 +255,7 @@ vitest-native ports tests from React Native's own test suite (Flow stripped, Jes
241
255
  - **Interpolation** — 12 numeric and string range mapping tests, including string output ranges (`deg`/`%`/arbitrary suffixes) and extrapolate modes (extend/clamp/identity)
242
256
  - **Animated** — 36 tests for listeners, events, forkEvent, diffClamp, Color normalization, sequence chaining/interruption/restart, parallel start/stop/no-double-stop, loop iterations/indefinite/interrupt/resetBeforeIteration, delay in sequence, stagger, and value tracking
243
257
 
244
- 102 tests ported from React Native's own test suite, all passing (`vitest run tests/rn-conformance/`). A few edge cases — hex-colour interpolation and infinite input ranges — are skipped and documented in the test files.
258
+ 118 tests ported from React Native's own test suite — 115 passing, with 3 edge cases (hex-colour interpolation and infinite input ranges) skipped and documented in the test files (`vitest run tests/rn-conformance/`).
245
259
 
246
260
  ---
247
261
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest-native",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "description": "Run real React Native tests under Vitest. One install, zero config.",
6
6
  "license": "MIT",