-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.d.ts
37 lines (33 loc) · 1.13 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { NightwatchAPI, Element } from 'nightwatch';
import { MountingOptions } from '@vue/test-utils';
import { Plugin } from 'vite';
type GlobalMountOptions = NonNullable<MountingOptions<any>['global']>;
declare module 'nightwatch' {
interface NightwatchAPI {
importScript(
scriptPath: string,
options: { scriptType: string; componentType: string },
callback?: () => void
): this;
mountReactComponent<TProps extends Record<string, any>>(
componentPath: string,
props?: TProps,
callback?: (this: NightwatchAPI, result: Element) => void
): Awaitable<this, Element>;
mountVueComponent(
componentPath: string,
options?: {
props?: MountingOptions<Record<string, any>>['props'];
plugin?: Pick<GlobalMountOptions, 'plugins'>;
mocks?: Pick<GlobalMountOptions, 'mocks'>;
},
callback?: (this: NightwatchAPI, result: Element) => void
): Awaitable<this, Element>;
launchComponentRenderer(): this;
}
}
interface Options {
renderPage: string;
componentType?: 'vue' | 'react';
}
export default function nightwatchPlugin(options?: Options): Plugin;