vitest-native 0.8.0 → 0.9.0
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/CHANGELOG.md +332 -0
- package/README.md +15 -1
- package/dist/cli.cjs +506 -0
- package/dist/cli.d.cts +4 -0
- package/dist/cli.d.mts +4 -0
- package/dist/cli.mjs +502 -0
- package/dist/ecosystem-BIWaVwYL.cjs +294 -0
- package/dist/ecosystem-EFtHnKS9.mjs +256 -0
- package/dist/{index-vlK4zxuK.d.mts → index-CEgRDdhd.d.cts} +13 -3
- package/dist/{index-YjjYELG7.d.cts → index-j-0tueBr.d.mts} +11 -5
- package/dist/index.cjs +345 -200
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +341 -196
- package/dist/jest-compat/setup.mjs +65 -1
- package/dist/native/boundary.mjs +108 -30
- package/dist/native/compile-cache.mjs +10 -5
- package/dist/native/explain.mjs +69 -0
- package/dist/native/hooks.mjs +76 -3
- package/dist/native/loader.mjs +35 -6
- package/dist/native/match.mjs +107 -8
- package/dist/native/registry.mjs +471 -0
- package/dist/native/reset.mjs +18 -12
- package/dist/native/runner.mjs +13 -7
- package/dist/native/setup.mjs +15 -1
- package/dist/native/transform.mjs +88 -19
- package/dist/native/worker.mjs +10 -1
- package/dist/pool-CJmjRgsB.mjs +117 -0
- package/dist/pool-DzsEo9vv.cjs +121 -0
- package/dist/{preset-map-BY9zk9Pj.cjs → preset-map-CG4FMtsl.cjs} +1 -0
- package/dist/{preset-map-DCWaM08s.mjs → preset-map-CNsZKfvu.mjs} +1 -0
- package/dist/{presets-7eMfp7o2.cjs → presets-C4faM3ds.cjs} +133 -2
- package/dist/{presets-23FJ76O4.mjs → presets-CuDrNA_W.mjs} +128 -3
- package/dist/presets.cjs +2 -1
- package/dist/presets.d.cts +2 -2
- package/dist/presets.d.mts +2 -2
- package/dist/presets.mjs +2 -2
- package/dist/setup.cjs +318 -130
- package/dist/setup.mjs +318 -130
- package/docs/hot-default-design.md +129 -0
- package/docs/migrating-from-jest.md +43 -7
- package/docs/migrating-from-vitest-react-native.md +1 -1
- package/docs/release-readiness.md +2 -1
- package/package.json +17 -5
- package/dist/pool-B7LBfcMQ.mjs +0 -67
- package/dist/pool-p54QV1dQ.cjs +0 -69
|
@@ -440,7 +440,26 @@ function buildPressableHostProps(props, ref) {
|
|
|
440
440
|
//#endregion
|
|
441
441
|
//#region src/mocks/components/Pressable.ts
|
|
442
442
|
function createPressableMock() {
|
|
443
|
-
const Pressable = React.forwardRef((props, ref) =>
|
|
443
|
+
const Pressable = React.forwardRef((props, ref) => {
|
|
444
|
+
const { style, children, onPressIn, onPressOut, ...rest } = props;
|
|
445
|
+
const [pressed, setPressed] = React.useState(false);
|
|
446
|
+
const state = { pressed };
|
|
447
|
+
const resolvedStyle = typeof style === "function" ? style(state) : style;
|
|
448
|
+
const resolvedChildren = typeof children === "function" ? children(state) : children;
|
|
449
|
+
const hostProps = buildPressableHostProps({
|
|
450
|
+
...rest,
|
|
451
|
+
style: resolvedStyle,
|
|
452
|
+
onPressIn: (e) => {
|
|
453
|
+
setPressed(true);
|
|
454
|
+
onPressIn?.(e);
|
|
455
|
+
},
|
|
456
|
+
onPressOut: (e) => {
|
|
457
|
+
setPressed(false);
|
|
458
|
+
onPressOut?.(e);
|
|
459
|
+
}
|
|
460
|
+
}, ref);
|
|
461
|
+
return React.createElement("Pressable", hostProps, resolvedChildren);
|
|
462
|
+
});
|
|
444
463
|
Pressable.displayName = "Pressable";
|
|
445
464
|
return Pressable;
|
|
446
465
|
}
|
|
@@ -2430,6 +2449,111 @@ function keyboardController() {
|
|
|
2430
2449
|
};
|
|
2431
2450
|
}
|
|
2432
2451
|
//#endregion
|
|
2452
|
+
//#region src/presets/worklets.ts
|
|
2453
|
+
const RuntimeKind = {
|
|
2454
|
+
ReactNative: 1,
|
|
2455
|
+
UI: 2,
|
|
2456
|
+
Worker: 3
|
|
2457
|
+
};
|
|
2458
|
+
const NOOP = () => {};
|
|
2459
|
+
const ID = (value) => value;
|
|
2460
|
+
const invoke = (callback) => callback();
|
|
2461
|
+
function worklets() {
|
|
2462
|
+
return {
|
|
2463
|
+
name: "worklets",
|
|
2464
|
+
modules: { "react-native-worklets": {
|
|
2465
|
+
exports: [
|
|
2466
|
+
"runOnJS",
|
|
2467
|
+
"runOnUI",
|
|
2468
|
+
"runOnUIAsync",
|
|
2469
|
+
"runOnUISync",
|
|
2470
|
+
"scheduleOnRN",
|
|
2471
|
+
"scheduleOnUI",
|
|
2472
|
+
"runOnRuntime",
|
|
2473
|
+
"runOnRuntimeAsync",
|
|
2474
|
+
"runOnRuntimeSync",
|
|
2475
|
+
"scheduleOnRuntime",
|
|
2476
|
+
"executeOnUIRuntimeSync",
|
|
2477
|
+
"createWorkletRuntime",
|
|
2478
|
+
"getRuntimeKind",
|
|
2479
|
+
"isRNRuntime",
|
|
2480
|
+
"isUIRuntime",
|
|
2481
|
+
"isWorkerRuntime",
|
|
2482
|
+
"isWorkletRuntime",
|
|
2483
|
+
"RuntimeKind",
|
|
2484
|
+
"makeShareable",
|
|
2485
|
+
"makeShareableCloneRecursive",
|
|
2486
|
+
"makeShareableCloneOnUIRecursive",
|
|
2487
|
+
"isShareable",
|
|
2488
|
+
"isShareableRef",
|
|
2489
|
+
"createShareable",
|
|
2490
|
+
"shareableMappingCache",
|
|
2491
|
+
"createSerializable",
|
|
2492
|
+
"isSerializableRef",
|
|
2493
|
+
"registerCustomSerializable",
|
|
2494
|
+
"serializableMappingCache",
|
|
2495
|
+
"createSynchronizable",
|
|
2496
|
+
"isSynchronizable",
|
|
2497
|
+
"getStaticFeatureFlag",
|
|
2498
|
+
"getDynamicFeatureFlag",
|
|
2499
|
+
"setDynamicFeatureFlag",
|
|
2500
|
+
"callMicrotasks",
|
|
2501
|
+
"isWorkletFunction",
|
|
2502
|
+
"WorkletsModule",
|
|
2503
|
+
"UIRuntimeId"
|
|
2504
|
+
],
|
|
2505
|
+
factory: () => {
|
|
2506
|
+
const runOnJS = (fn) => fn;
|
|
2507
|
+
const runOnUI = (fn) => fn;
|
|
2508
|
+
const runOnUIAsync = (worklet, ...args) => Promise.resolve(worklet(...args));
|
|
2509
|
+
const api = {
|
|
2510
|
+
__esModule: true,
|
|
2511
|
+
runOnJS,
|
|
2512
|
+
runOnUI,
|
|
2513
|
+
runOnUIAsync,
|
|
2514
|
+
runOnUISync: invoke,
|
|
2515
|
+
scheduleOnRN: (fn, ...args) => fn(...args),
|
|
2516
|
+
scheduleOnUI: (worklet, ...args) => worklet(...args),
|
|
2517
|
+
runOnRuntime: ID,
|
|
2518
|
+
runOnRuntimeAsync: (_runtime, worklet, ...args) => Promise.resolve(worklet(...args)),
|
|
2519
|
+
runOnRuntimeSync: (_runtime, worklet, ...args) => worklet(...args),
|
|
2520
|
+
scheduleOnRuntime: invoke,
|
|
2521
|
+
executeOnUIRuntimeSync: ID,
|
|
2522
|
+
callMicrotasks: NOOP,
|
|
2523
|
+
createWorkletRuntime: () => ({}),
|
|
2524
|
+
getRuntimeKind: () => RuntimeKind.ReactNative,
|
|
2525
|
+
RuntimeKind,
|
|
2526
|
+
isRNRuntime: () => true,
|
|
2527
|
+
isUIRuntime: () => false,
|
|
2528
|
+
isWorkerRuntime: () => false,
|
|
2529
|
+
isWorkletRuntime: () => false,
|
|
2530
|
+
UIRuntimeId: 1,
|
|
2531
|
+
makeShareable: ID,
|
|
2532
|
+
makeShareableCloneRecursive: ID,
|
|
2533
|
+
makeShareableCloneOnUIRecursive: ID,
|
|
2534
|
+
createShareable: ID,
|
|
2535
|
+
isShareable: () => false,
|
|
2536
|
+
isShareableRef: () => true,
|
|
2537
|
+
shareableMappingCache: /* @__PURE__ */ new Map(),
|
|
2538
|
+
createSerializable: ID,
|
|
2539
|
+
isSerializableRef: ID,
|
|
2540
|
+
registerCustomSerializable: NOOP,
|
|
2541
|
+
serializableMappingCache: /* @__PURE__ */ new Map(),
|
|
2542
|
+
createSynchronizable: ID,
|
|
2543
|
+
isSynchronizable: () => false,
|
|
2544
|
+
getStaticFeatureFlag: () => false,
|
|
2545
|
+
getDynamicFeatureFlag: () => false,
|
|
2546
|
+
setDynamicFeatureFlag: NOOP,
|
|
2547
|
+
isWorkletFunction: () => false,
|
|
2548
|
+
WorkletsModule: {}
|
|
2549
|
+
};
|
|
2550
|
+
api.default = api;
|
|
2551
|
+
return api;
|
|
2552
|
+
}
|
|
2553
|
+
} }
|
|
2554
|
+
};
|
|
2555
|
+
}
|
|
2556
|
+
//#endregion
|
|
2433
2557
|
//#region src/presets/index.ts
|
|
2434
2558
|
var presets_exports = /* @__PURE__ */ __exportAll({
|
|
2435
2559
|
asyncStorage: () => asyncStorage,
|
|
@@ -2446,7 +2570,8 @@ var presets_exports = /* @__PURE__ */ __exportAll({
|
|
|
2446
2570
|
screens: () => screens,
|
|
2447
2571
|
svg: () => svg,
|
|
2448
2572
|
vectorIcons: () => vectorIcons,
|
|
2449
|
-
webview: () => webview
|
|
2573
|
+
webview: () => webview,
|
|
2574
|
+
worklets: () => worklets
|
|
2450
2575
|
});
|
|
2451
2576
|
//#endregion
|
|
2452
|
-
export {
|
|
2577
|
+
export { navigation as C, buildPressableHostProps as D, createPressableMock as E, reanimated as O, asyncStorage as S, gestureHandler as T, svg as _, bottomSheet as a, expo as b, createTouchableOpacityMock as c, createFlatListMock as d, createScrollViewMock as f, webview as g, vectorIcons as h, createViewMock as i, createVirtualizedListMock as l, flashList as m, worklets as n, createTouchableWithoutFeedbackMock as o, createTextInputMock as p, keyboardController as r, createTouchableHighlightMock as s, presets_exports as t, createSectionListMock as u, mmkv as v, safeAreaContext as w, screens as x, deviceInfo as y };
|
package/dist/presets.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_presets = require("./presets-
|
|
2
|
+
const require_presets = require("./presets-C4faM3ds.cjs");
|
|
3
3
|
exports.asyncStorage = require_presets.asyncStorage;
|
|
4
4
|
exports.bottomSheet = require_presets.bottomSheet;
|
|
5
5
|
exports.deviceInfo = require_presets.deviceInfo;
|
|
@@ -15,3 +15,4 @@ exports.screens = require_presets.screens;
|
|
|
15
15
|
exports.svg = require_presets.svg;
|
|
16
16
|
exports.vectorIcons = require_presets.vectorIcons;
|
|
17
17
|
exports.webview = require_presets.webview;
|
|
18
|
+
exports.worklets = require_presets.worklets;
|
package/dist/presets.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { asyncStorage, bottomSheet, deviceInfo, expo, flashList, gestureHandler, keyboardController, mmkv, navigation, reanimated, safeAreaContext, screens, svg, vectorIcons, webview };
|
|
1
|
+
import { _ as reanimated, a as flashList, c as svg, d as expo, f as screens, g as gestureHandler, h as safeAreaContext, i as bottomSheet, l as mmkv, m as navigation, n as worklets, o as vectorIcons, p as asyncStorage, r as keyboardController, s as webview, u as deviceInfo } from "./index-CEgRDdhd.cjs";
|
|
2
|
+
export { asyncStorage, bottomSheet, deviceInfo, expo, flashList, gestureHandler, keyboardController, mmkv, navigation, reanimated, safeAreaContext, screens, svg, vectorIcons, webview, worklets };
|
package/dist/presets.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { asyncStorage, bottomSheet, deviceInfo, expo, flashList, gestureHandler, keyboardController, mmkv, navigation, reanimated, safeAreaContext, screens, svg, vectorIcons, webview };
|
|
1
|
+
import { _ as reanimated, a as flashList, c as svg, d as expo, f as screens, g as gestureHandler, h as safeAreaContext, i as bottomSheet, l as mmkv, m as navigation, n as worklets, o as vectorIcons, p as asyncStorage, r as keyboardController, s as webview, u as deviceInfo } from "./index-j-0tueBr.mjs";
|
|
2
|
+
export { asyncStorage, bottomSheet, deviceInfo, expo, flashList, gestureHandler, keyboardController, mmkv, navigation, reanimated, safeAreaContext, screens, svg, vectorIcons, webview, worklets };
|
package/dist/presets.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
export { asyncStorage, bottomSheet, deviceInfo, expo, flashList, gestureHandler, keyboardController, mmkv, navigation, reanimated, safeAreaContext, screens, svg, vectorIcons, webview };
|
|
1
|
+
import { C as navigation, O as reanimated, S as asyncStorage, T as gestureHandler, _ as svg, a as bottomSheet, b as expo, g as webview, h as vectorIcons, m as flashList, n as worklets, r as keyboardController, v as mmkv, w as safeAreaContext, x as screens, y as deviceInfo } from "./presets-CuDrNA_W.mjs";
|
|
2
|
+
export { asyncStorage, bottomSheet, deviceInfo, expo, flashList, gestureHandler, keyboardController, mmkv, navigation, reanimated, safeAreaContext, screens, svg, vectorIcons, webview, worklets };
|