vitest-native 0.10.0 → 0.11.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 (39) hide show
  1. package/CHANGELOG.md +257 -0
  2. package/README.md +1 -0
  3. package/dist/cli.cjs +25 -7
  4. package/dist/cli.mjs +22 -4
  5. package/dist/{ecosystem-IuZ-Gv0R.cjs → ecosystem-DGlajfDG.cjs} +280 -14
  6. package/dist/{ecosystem-CO5vqExO.mjs → ecosystem-DJMGR2YY.mjs} +254 -12
  7. package/dist/helpers.cjs +1 -1
  8. package/dist/helpers.mjs +1 -1
  9. package/dist/{index-BJL4cQ-l.d.cts → index-CrMeE8rd.d.mts} +5 -5
  10. package/dist/{index-CvCU0cLl.d.mts → index-DIMbjH8R.d.cts} +6 -3
  11. package/dist/index.d.mts +1 -2
  12. package/dist/index.mjs +78 -48
  13. package/dist/jest-compat.cjs +4 -4
  14. package/dist/jest-compat.d.cts +0 -1
  15. package/dist/jest-compat.d.mts +0 -1
  16. package/dist/jest-compat.mjs +2 -2
  17. package/dist/native/hooks.mjs +77 -12
  18. package/dist/native/loader.mjs +10 -5
  19. package/dist/native/match.d.mts +33 -0
  20. package/dist/native/match.mjs +94 -22
  21. package/dist/native/registry.mjs +30 -2
  22. package/dist/{pool-CFND7plG.cjs → pool-BU-1ecIF.cjs} +6 -6
  23. package/dist/{pool-Bcxp4Qrg.mjs → pool-Bcxn9a3I.mjs} +3 -3
  24. package/dist/{preset-map-DxilQ4pI.cjs → preset-map-BoG19dLa.cjs} +1 -0
  25. package/dist/{preset-map-BpDG_D5m.mjs → preset-map-DuX0ocdn.mjs} +1 -0
  26. package/dist/{presets-BGTqVH6C.cjs → presets-CwO_c4aL.cjs} +131 -6
  27. package/dist/{presets-CK85x8ey.mjs → presets-IStcJEOa.mjs} +123 -4
  28. package/dist/presets.d.mts +2 -2
  29. package/dist/presets.mjs +2 -2
  30. package/dist/{chunk-CjcI7cDX.mjs → rolldown-runtime-BhDjJH2R.mjs} +1 -1
  31. package/dist/{chunk-CZWwpsFl.cjs → rolldown-runtime-C0BPl7ul.cjs} +1 -1
  32. package/dist/serializer.cjs +1 -1
  33. package/dist/serializer.mjs +1 -1
  34. package/dist/setup.d.mts +1 -1
  35. package/dist/setup.mjs +5 -5
  36. package/docs/versioning.md +1 -1
  37. package/package.json +17 -15
  38. /package/dist/{errors-flXDIeWk.cjs → errors-B3lJK46O.cjs} +0 -0
  39. /package/dist/{errors-Dm5yLNTF.mjs → errors-CxoBUfVJ.mjs} +0 -0
@@ -8,7 +8,7 @@
8
8
  * Usage: expect.addSnapshotSerializer(serializer)
9
9
  */
10
10
  /** Props that are React internals and should be omitted from snapshot output. */
11
- const INTERNAL_PROPS = new Set([
11
+ const INTERNAL_PROPS = /* @__PURE__ */ new Set([
12
12
  "__reactFiber",
13
13
  "__reactInternalInstance",
14
14
  "__reactEvents",
package/dist/setup.d.mts CHANGED
@@ -1 +1 @@
1
- export { };
1
+ export {}
package/dist/setup.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { n as __require } from "./chunk-CjcI7cDX.mjs";
2
- import { t as AUTO_DETECT_PRESETS } from "./preset-map-BpDG_D5m.mjs";
3
- import { D as buildPressableHostProps, E as createPressableMock, c as createTouchableOpacityMock, d as createFlatListMock, f as createScrollViewMock, i as createViewMock, l as createVirtualizedListMock, o as createTouchableWithoutFeedbackMock, p as createTextInputMock, s as createTouchableHighlightMock, t as presets_exports, u as createSectionListMock } from "./presets-CK85x8ey.mjs";
1
+ import { n as __require } from "./rolldown-runtime-BhDjJH2R.mjs";
2
+ import { t as AUTO_DETECT_PRESETS } from "./preset-map-DuX0ocdn.mjs";
3
+ import { D as createPressableMock, O as buildPressableHostProps, c as createTouchableOpacityMock, d as createFlatListMock, f as createScrollViewMock, i as createViewMock, l as createVirtualizedListMock, o as createTouchableWithoutFeedbackMock, p as createTextInputMock, s as createTouchableHighlightMock, t as presets_exports, u as createSectionListMock } from "./presets-IStcJEOa.mjs";
4
4
  import { serializer } from "./serializer.mjs";
5
5
  import { animatedMatchers } from "./matchers.mjs";
6
6
  import { createRequire } from "node:module";
@@ -1815,7 +1815,7 @@ const NEWTON_MIN_SLOPE = .001;
1815
1815
  const SUBDIVISION_PRECISION = 1e-7;
1816
1816
  const SUBDIVISION_MAX_ITERATIONS = 10;
1817
1817
  const kSplineTableSize = 11;
1818
- const kSampleStepSize = 1 / (kSplineTableSize - 1);
1818
+ const kSampleStepSize = 1 / 10;
1819
1819
  function A(aA1, aA2) {
1820
1820
  return 1 - 3 * aA2 + 3 * aA1;
1821
1821
  }
@@ -1863,7 +1863,7 @@ function bezier(mX1, mY1, mX2, mY2) {
1863
1863
  function getTForX(aX) {
1864
1864
  let intervalStart = 0;
1865
1865
  let currentSample = 1;
1866
- const lastSample = kSplineTableSize - 1;
1866
+ const lastSample = 10;
1867
1867
  for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) intervalStart += kSampleStepSize;
1868
1868
  --currentSample;
1869
1869
  const dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
@@ -24,7 +24,7 @@ and deep paths are not supported even when they happen to resolve.
24
24
  | --- | --- |
25
25
  | `vitest-native` | `reactNative`, `presets`, `disabledPresetNames` |
26
26
  | `vitest-native/helpers` | `setPlatform`, `setDimensions`, `setColorScheme`, `setInsets`, `mockNativeModule`, `resetAllMocks` |
27
- | `vitest-native/presets` | the 16 preset factories, by name |
27
+ | `vitest-native/presets` | the 17 preset factories, by name |
28
28
  | `vitest-native/matchers` | `toHaveAnimatedStyle`, `toHaveAnimatedProps`, `animatedMatchers` |
29
29
  | `vitest-native/serializer` | `serializer` |
30
30
  | `vitest-native/jest-compat` | `jestMockTransform`, `jestCompatAliases`, `jestCompatSetup` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vitest-native",
3
- "version": "0.10.0",
3
+ "version": "0.11.1",
4
4
  "type": "module",
5
5
  "description": "Run real React Native tests under Vitest. One install, zero config.",
6
6
  "license": "MIT",
@@ -135,16 +135,17 @@
135
135
  "devDependencies": {
136
136
  "@babel/core": "^7.29.7",
137
137
  "@gorhom/bottom-sheet": "5.2.14",
138
+ "@react-native-community/netinfo": "12.0.1",
138
139
  "@react-native-vector-icons/common": "13.0.1",
139
140
  "@react-native-vector-icons/material-icons": "13.1.2",
140
- "@react-native/babel-preset": "^0.85.3",
141
- "@react-navigation/native": "7.2.5",
142
- "@react-navigation/native-stack": "7.16.0",
141
+ "@react-native/babel-preset": "^0.86.2",
142
+ "@react-navigation/native": "7.3.14",
143
+ "@react-navigation/native-stack": "7.18.6",
143
144
  "@shopify/flash-list": "2.3.2",
144
145
  "@testing-library/react-native": "14.0.0",
145
146
  "@types/node": "25.3.5",
146
- "@types/react": "19.2.14",
147
- "@vitest/coverage-v8": "4.1.9",
147
+ "@types/react": "19.2.18",
148
+ "@vitest/coverage-v8": "4.1.10",
148
149
  "expo-constants": "56.0.16",
149
150
  "expo-status-bar": "56.0.4",
150
151
  "ext-platform-lib": "file:./tests-native/fixtures/ext-platform-lib",
@@ -152,27 +153,28 @@
152
153
  "generic-mainfield-lib": "file:./tests-native/fixtures/generic-mainfield-lib",
153
154
  "react": "^19.2.8",
154
155
  "react-native": "^0.86.0",
155
- "react-native-gesture-handler": "3.0.0",
156
- "react-native-keyboard-controller": "1.21.11",
157
- "react-native-reanimated": "4.3.1",
156
+ "react-native-gesture-handler": "3.1.0",
157
+ "react-native-keyboard-controller": "1.22.2",
158
+ "react-native-reanimated": "4.5.3",
158
159
  "react-native-safe-area-context": "5.8.0",
159
- "react-native-worklets": "0.9.1",
160
+ "react-native-worklets": "0.11.3",
160
161
  "react-test-renderer": "^19.2.8",
161
162
  "resident-singleton": "file:./tests-native/fixtures/resident-singleton",
163
+ "rn-condition-cjs-lib": "file:./tests-native/fixtures/rn-condition-cjs-lib",
162
164
  "rn-condition-lib": "file:./tests-native/fixtures/rn-condition-lib",
163
165
  "rn-ecosystem-lib": "file:./tests-native/fixtures/rn-ecosystem-lib",
164
166
  "rn-mainfield-lib": "file:./tests-native/fixtures/rn-mainfield-lib",
165
167
  "rn-platform-flow-lib": "file:./tests-native/fixtures/rn-platform-flow-lib",
166
168
  "rn-singleton-lib": "file:./tests-native/fixtures/rn-singleton-lib",
167
169
  "test-renderer": "^1.2.0",
168
- "tsdown": "0.21.10",
170
+ "tsdown": "0.22.14",
169
171
  "typescript": "6.0.3",
170
172
  "untranspiled-jsx-lib": "file:./tests-native/fixtures/untranspiled-jsx-lib",
171
- "vite": "^8.0.5",
172
- "vitest": "4.1.9"
173
+ "vite": "^8.2.0",
174
+ "vitest": "4.1.10"
173
175
  },
174
176
  "scripts": {
175
- "build": "tsdown && node scripts/copy-static-types.mjs",
177
+ "build": "bunx --bun tsdown && node scripts/copy-static-types.mjs",
176
178
  "test": "vitest run",
177
179
  "test:native": "vitest run --config tests-native/vitest.config.mts",
178
180
  "test:native:forks": "vitest run --config tests-native/vitest.forks.config.mts",
@@ -198,7 +200,7 @@
198
200
  "validate:hot-parity": "node validation/idiomatic/scale/run-compare.mjs"
199
201
  },
200
202
  "dependencies": {
201
- "flow-remove-types": "^2.322.0",
203
+ "flow-remove-types": "^2.325.0",
202
204
  "magic-string": "^1.1.0"
203
205
  },
204
206
  "bin": {