@wevu/test-utils 1.0.0 → 1.1.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/dist/mount.d.mts +0 -2
- package/dist/mountComponent.d.mts +1 -3
- package/dist/types.d.mts +1 -2
- package/dist/vitest.d.mts +1 -3
- package/package.json +6 -6
package/dist/mount.d.mts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { MountOptions, TestSetupFunction, WevuTestWrapper } from "./types.mjs";
|
|
2
2
|
import { mountComponent } from "./mountComponent.mjs";
|
|
3
|
-
//#region src/mount.d.ts
|
|
4
3
|
type MountSubject<Bindings extends Record<string, any>, Props extends Record<string, any>> = TestSetupFunction<Bindings, Props> | {
|
|
5
4
|
setup?: TestSetupFunction<Bindings, Props>;
|
|
6
5
|
};
|
|
7
6
|
export declare function mount<Bindings extends Record<string, any> = Record<string, any>, Props extends Record<string, any> = Record<string, any>, Data extends Record<string, any> = Record<string, any>>(subject: MountSubject<Bindings, Props> | Record<string, any>, options?: MountOptions<Props, Data>): WevuTestWrapper<Bindings, Props, Data>;
|
|
8
7
|
export declare function mountComposable<Bindings extends Record<string, any> = Record<string, any>, Props extends Record<string, any> = Record<string, any>, Data extends Record<string, any> = Record<string, any>>(setup: TestSetupFunction<Bindings, Props>, options?: MountOptions<Props, Data>): WevuTestWrapper<Bindings, Props, Data>;
|
|
9
|
-
//#endregion
|
|
10
8
|
export { mountComponent };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { ComponentBindingsOf, ComponentMountOptions, ComponentPropsOf, WevuTestWrapper } from "./types.mjs";
|
|
2
|
-
//#region src/mountComponent.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* 挂载不渲染模板的 Wevu 组件逻辑层。
|
|
5
4
|
*
|
|
6
5
|
* @param component 编译后的 SFC 默认导出、组件选项或 Wevu 组件定义
|
|
7
6
|
* @param options 挂载选项
|
|
8
7
|
*/
|
|
9
|
-
export declare function mountComponent<Component extends object, Props extends Record<string, any> = ComponentPropsOf<Component>, Data extends Record<string, any> = Record<string, any>>(component: Component, options?: ComponentMountOptions<Props>): WevuTestWrapper<ComponentBindingsOf<Component>, Props, Data>;
|
|
10
|
-
//#endregion
|
|
8
|
+
export declare function mountComponent<Component extends object, Props extends Record<string, any> = ComponentPropsOf<Component>, Data extends Record<string, any> = Record<string, any>>(component: Component, options?: ComponentMountOptions<Props>): WevuTestWrapper<ComponentBindingsOf<Component>, Props, Data>;
|
package/dist/types.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentPropsOptions, CreateAppOptions, DefineComponentOptions, InternalRuntimeState, MiniProgramAdapter, RuntimeInstance, SetDataSnapshotOptions, SetupContext, WevuPlugin } from "wevu";
|
|
2
|
-
//#region src/types.d.ts
|
|
3
2
|
export type TestSetupContext = SetupContext<any, any, any, ComponentPropsOptions>;
|
|
4
3
|
export type TestSetupFunction<Bindings extends Record<string, any> = Record<string, any>, Props extends Record<string, any> = Record<string, any>> = (props: Props, context: TestSetupContext) => Bindings | void;
|
|
5
4
|
export type TestPlugin = WevuPlugin | readonly [WevuPlugin, ...any[]];
|
|
@@ -55,4 +54,4 @@ export interface WevuTestWrapper<Bindings extends Record<string, any> = Record<s
|
|
|
55
54
|
nextTick: () => Promise<void>;
|
|
56
55
|
unmount: () => void;
|
|
57
56
|
}
|
|
58
|
-
|
|
57
|
+
export {};
|
package/dist/vitest.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/vitest.d.ts
|
|
2
1
|
export interface WevuSfcPlugin {
|
|
3
2
|
name: string;
|
|
4
3
|
enforce: 'pre';
|
|
@@ -25,5 +24,4 @@ export interface WevuSfcOptions {
|
|
|
25
24
|
*
|
|
26
25
|
* 该插件只输出 SFC script,不加载 Vue Web runtime,也不渲染模板、样式或 WXML。
|
|
27
26
|
*/
|
|
28
|
-
export declare function wevuSfc(options?: WevuSfcOptions): WevuSfcPlugin;
|
|
29
|
-
//#endregion
|
|
27
|
+
export declare function wevuSfc(options?: WevuSfcOptions): WevuSfcPlugin;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wevu/test-utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"description": "Lightweight test utilities for Wevu Composition API logic",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -45,17 +45,17 @@
|
|
|
45
45
|
"dist"
|
|
46
46
|
],
|
|
47
47
|
"engines": {
|
|
48
|
-
"node": "^22.
|
|
48
|
+
"node": "^22.23.4 || ^24.22.1 || >=26.12.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"wevu": "7.
|
|
51
|
+
"wevu": "7.7.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@weapp-core/constants": "0.
|
|
55
|
-
"@wevu/compiler": "7.
|
|
54
|
+
"@weapp-core/constants": "0.5.0",
|
|
55
|
+
"@wevu/compiler": "7.7.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"wevu": "7.
|
|
58
|
+
"wevu": "7.7.0"
|
|
59
59
|
},
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public",
|