chore(ct): svelte mount options type dedupe (#16868)

This commit is contained in:
sand4rt 2022-08-29 18:10:50 +02:00 committed by GitHub
parent a10bd6a7c6
commit 3464edf89d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,23 +34,20 @@ export type PlaywrightTestConfig = Omit<BasePlaywrightTestConfig, 'use'> & {
}
};
export interface MountOptions<Props = Record<string, unknown>> {
props?: Props,
slots?: Record<string, unknown>,
on?: Record<string, Function>,
hooksConfig?: any,
}
interface MountResult extends Locator {
unmount(): Promise<void>;
}
interface ComponentFixtures {
mount(component: any, options?: {
props?: { [key: string]: any },
slots?: { [key: string]: any },
on?: { [key: string]: Function },
hooksConfig?: any,
}): Promise<MountResult>;
mount<Props>(component: any, options: {
props: Props,
slots?: { [key: string]: any },
on?: { [key: string]: Function },
hooksConfig?: any,
}): Promise<MountResult>;
mount(component: any, options?: MountOptions): Promise<MountResult>;
mount<Props>(component: any, options: MountOptions<Required<Props>>): Promise<MountResult>;
}
export const test: TestType<