chore(ct): dedupe types (#28816)
This commit is contained in:
parent
76ab990208
commit
28875fa608
25
packages/playwright-ct-core/index.d.ts
vendored
25
packages/playwright-ct-core/index.d.ts
vendored
|
|
@ -15,15 +15,13 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
TestType,
|
TestType as BaseTestType,
|
||||||
PlaywrightTestArgs,
|
PlaywrightTestArgs,
|
||||||
PlaywrightTestConfig as BasePlaywrightTestConfig,
|
PlaywrightTestConfig as BasePlaywrightTestConfig,
|
||||||
PlaywrightTestOptions,
|
PlaywrightTestOptions,
|
||||||
PlaywrightWorkerArgs,
|
PlaywrightWorkerArgs,
|
||||||
PlaywrightWorkerOptions,
|
PlaywrightWorkerOptions,
|
||||||
Locator,
|
|
||||||
} from 'playwright/test';
|
} from 'playwright/test';
|
||||||
import type { JsonObject } from './types/component';
|
|
||||||
import type { InlineConfig } from 'vite';
|
import type { InlineConfig } from 'vite';
|
||||||
|
|
||||||
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
||||||
|
|
@ -35,30 +33,11 @@ export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface MountOptions<HooksConfig extends JsonObject> {
|
export type TestType<ComponentFixtures> = BaseTestType<
|
||||||
hooksConfig?: HooksConfig;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MountResult extends Locator {
|
|
||||||
unmount(): Promise<void>;
|
|
||||||
update(component: JSX.Element): Promise<void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ComponentFixtures {
|
|
||||||
mount<HooksConfig extends JsonObject>(
|
|
||||||
component: JSX.Element,
|
|
||||||
options?: MountOptions<HooksConfig>
|
|
||||||
): Promise<MountResult>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const test: TestType<
|
|
||||||
PlaywrightTestArgs & PlaywrightTestOptions & ComponentFixtures,
|
PlaywrightTestArgs & PlaywrightTestOptions & ComponentFixtures,
|
||||||
PlaywrightWorkerArgs & PlaywrightWorkerOptions
|
PlaywrightWorkerArgs & PlaywrightWorkerOptions
|
||||||
>;
|
>;
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines Playwright config
|
|
||||||
*/
|
|
||||||
export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig;
|
export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig;
|
||||||
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
|
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
|
||||||
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;
|
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;
|
||||||
|
|
|
||||||
41
packages/playwright-ct-react/index.d.ts
vendored
41
packages/playwright-ct-react/index.d.ts
vendored
|
|
@ -14,26 +14,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {
|
import type { Locator } from 'playwright/test';
|
||||||
TestType,
|
|
||||||
PlaywrightTestArgs,
|
|
||||||
PlaywrightTestConfig as BasePlaywrightTestConfig,
|
|
||||||
PlaywrightTestOptions,
|
|
||||||
PlaywrightWorkerArgs,
|
|
||||||
PlaywrightWorkerOptions,
|
|
||||||
Locator,
|
|
||||||
} from 'playwright/test';
|
|
||||||
import type { JsonObject } from '@playwright/experimental-ct-core/types/component';
|
import type { JsonObject } from '@playwright/experimental-ct-core/types/component';
|
||||||
import type { InlineConfig } from 'vite';
|
import type { TestType } from '@playwright/experimental-ct-core';
|
||||||
|
|
||||||
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
|
||||||
use?: BasePlaywrightTestConfig<T, W>['use'] & {
|
|
||||||
ctPort?: number;
|
|
||||||
ctTemplateDir?: string;
|
|
||||||
ctCacheDir?: string;
|
|
||||||
ctViteConfig?: InlineConfig | (() => Promise<InlineConfig>);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface MountOptions<HooksConfig extends JsonObject> {
|
export interface MountOptions<HooksConfig extends JsonObject> {
|
||||||
hooksConfig?: HooksConfig;
|
hooksConfig?: HooksConfig;
|
||||||
|
|
@ -44,26 +27,12 @@ interface MountResult extends Locator {
|
||||||
update(component: JSX.Element): Promise<void>;
|
update(component: JSX.Element): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ComponentFixtures {
|
export const test: TestType<{
|
||||||
mount<HooksConfig extends JsonObject>(
|
mount<HooksConfig extends JsonObject>(
|
||||||
component: JSX.Element,
|
component: JSX.Element,
|
||||||
options?: MountOptions<HooksConfig>
|
options?: MountOptions<HooksConfig>
|
||||||
): Promise<MountResult>;
|
): Promise<MountResult>;
|
||||||
}
|
}>;
|
||||||
|
|
||||||
export const test: TestType<
|
|
||||||
PlaywrightTestArgs & PlaywrightTestOptions & ComponentFixtures,
|
|
||||||
PlaywrightWorkerArgs & PlaywrightWorkerOptions
|
|
||||||
>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines Playwright config
|
|
||||||
*/
|
|
||||||
export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig;
|
|
||||||
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
|
|
||||||
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;
|
|
||||||
export function defineConfig(config: PlaywrightTestConfig, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig;
|
|
||||||
export function defineConfig<T>(config: PlaywrightTestConfig<T>, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig<T>;
|
|
||||||
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig<T, W>;
|
|
||||||
|
|
||||||
|
export { defineConfig, PlaywrightTestConfig } from '@playwright/experimental-ct-core';
|
||||||
export { expect, devices } from 'playwright/test';
|
export { expect, devices } from 'playwright/test';
|
||||||
|
|
|
||||||
2
packages/playwright-ct-react/register.d.ts
vendored
2
packages/playwright-ct-react/register.d.ts
vendored
|
|
@ -14,4 +14,4 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default function pwRegister(components: Record<string, any>): void
|
export default function pwRegister(components: Record<string, any>): void;
|
||||||
|
|
|
||||||
41
packages/playwright-ct-react17/index.d.ts
vendored
41
packages/playwright-ct-react17/index.d.ts
vendored
|
|
@ -14,26 +14,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {
|
import type { Locator } from 'playwright/test';
|
||||||
TestType,
|
|
||||||
PlaywrightTestArgs,
|
|
||||||
PlaywrightTestConfig as BasePlaywrightTestConfig,
|
|
||||||
PlaywrightTestOptions,
|
|
||||||
PlaywrightWorkerArgs,
|
|
||||||
PlaywrightWorkerOptions,
|
|
||||||
Locator,
|
|
||||||
} from 'playwright/test';
|
|
||||||
import type { JsonObject } from '@playwright/experimental-ct-core/types/component';
|
import type { JsonObject } from '@playwright/experimental-ct-core/types/component';
|
||||||
import type { InlineConfig } from 'vite';
|
import type { TestType } from '@playwright/experimental-ct-core';
|
||||||
|
|
||||||
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
|
||||||
use?: BasePlaywrightTestConfig<T, W>['use'] & {
|
|
||||||
ctPort?: number;
|
|
||||||
ctTemplateDir?: string;
|
|
||||||
ctCacheDir?: string;
|
|
||||||
ctViteConfig?: InlineConfig | (() => Promise<InlineConfig>);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface MountOptions<HooksConfig extends JsonObject> {
|
export interface MountOptions<HooksConfig extends JsonObject> {
|
||||||
hooksConfig?: HooksConfig;
|
hooksConfig?: HooksConfig;
|
||||||
|
|
@ -44,26 +27,12 @@ interface MountResult extends Locator {
|
||||||
update(component: JSX.Element): Promise<void>;
|
update(component: JSX.Element): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ComponentFixtures {
|
export const test: TestType<{
|
||||||
mount<HooksConfig extends JsonObject>(
|
mount<HooksConfig extends JsonObject>(
|
||||||
component: JSX.Element,
|
component: JSX.Element,
|
||||||
options?: MountOptions<HooksConfig>
|
options?: MountOptions<HooksConfig>
|
||||||
): Promise<MountResult>;
|
): Promise<MountResult>;
|
||||||
}
|
}>;
|
||||||
|
|
||||||
export const test: TestType<
|
|
||||||
PlaywrightTestArgs & PlaywrightTestOptions & ComponentFixtures,
|
|
||||||
PlaywrightWorkerArgs & PlaywrightWorkerOptions
|
|
||||||
>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines Playwright config
|
|
||||||
*/
|
|
||||||
export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig;
|
|
||||||
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
|
|
||||||
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;
|
|
||||||
export function defineConfig(config: PlaywrightTestConfig, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig;
|
|
||||||
export function defineConfig<T>(config: PlaywrightTestConfig<T>, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig<T>;
|
|
||||||
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig<T, W>;
|
|
||||||
|
|
||||||
|
export { defineConfig, PlaywrightTestConfig } from '@playwright/experimental-ct-core';
|
||||||
export { expect, devices } from 'playwright/test';
|
export { expect, devices } from 'playwright/test';
|
||||||
|
|
|
||||||
2
packages/playwright-ct-react17/register.d.ts
vendored
2
packages/playwright-ct-react17/register.d.ts
vendored
|
|
@ -14,4 +14,4 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default function pwRegister(components: Record<string, any>): void
|
export default function pwRegister(components: Record<string, any>): void;
|
||||||
|
|
|
||||||
41
packages/playwright-ct-solid/index.d.ts
vendored
41
packages/playwright-ct-solid/index.d.ts
vendored
|
|
@ -14,26 +14,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {
|
import type { Locator } from 'playwright/test';
|
||||||
TestType,
|
|
||||||
PlaywrightTestArgs,
|
|
||||||
PlaywrightTestConfig as BasePlaywrightTestConfig,
|
|
||||||
PlaywrightTestOptions,
|
|
||||||
PlaywrightWorkerArgs,
|
|
||||||
PlaywrightWorkerOptions,
|
|
||||||
Locator,
|
|
||||||
} from 'playwright/test';
|
|
||||||
import type { JsonObject } from '@playwright/experimental-ct-core/types/component';
|
import type { JsonObject } from '@playwright/experimental-ct-core/types/component';
|
||||||
import type { InlineConfig } from 'vite';
|
import type { TestType } from '@playwright/experimental-ct-core';
|
||||||
|
|
||||||
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
|
||||||
use?: BasePlaywrightTestConfig<T, W>['use'] & {
|
|
||||||
ctPort?: number;
|
|
||||||
ctTemplateDir?: string;
|
|
||||||
ctCacheDir?: string;
|
|
||||||
ctViteConfig?: InlineConfig | (() => Promise<InlineConfig>);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface MountOptions<HooksConfig extends JsonObject> {
|
export interface MountOptions<HooksConfig extends JsonObject> {
|
||||||
hooksConfig?: HooksConfig;
|
hooksConfig?: HooksConfig;
|
||||||
|
|
@ -44,26 +27,12 @@ interface MountResult extends Locator {
|
||||||
update(component: JSX.Element): Promise<void>;
|
update(component: JSX.Element): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ComponentFixtures {
|
export const test: TestType<{
|
||||||
mount<HooksConfig extends JsonObject>(
|
mount<HooksConfig extends JsonObject>(
|
||||||
component: JSX.Element,
|
component: JSX.Element,
|
||||||
options?: MountOptions<HooksConfig>
|
options?: MountOptions<HooksConfig>
|
||||||
): Promise<MountResult>;
|
): Promise<MountResult>;
|
||||||
}
|
}>;
|
||||||
|
|
||||||
export const test: TestType<
|
|
||||||
PlaywrightTestArgs & PlaywrightTestOptions & ComponentFixtures,
|
|
||||||
PlaywrightWorkerArgs & PlaywrightWorkerOptions
|
|
||||||
>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines Playwright config
|
|
||||||
*/
|
|
||||||
export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig;
|
|
||||||
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
|
|
||||||
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;
|
|
||||||
export function defineConfig(config: PlaywrightTestConfig, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig;
|
|
||||||
export function defineConfig<T>(config: PlaywrightTestConfig<T>, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig<T>;
|
|
||||||
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig<T, W>;
|
|
||||||
|
|
||||||
|
export { defineConfig, PlaywrightTestConfig } from '@playwright/experimental-ct-core';
|
||||||
export { expect, devices } from 'playwright/test';
|
export { expect, devices } from 'playwright/test';
|
||||||
|
|
|
||||||
2
packages/playwright-ct-solid/register.d.ts
vendored
2
packages/playwright-ct-solid/register.d.ts
vendored
|
|
@ -14,4 +14,4 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default function pwRegister(components: Record<string, any>): void
|
export default function pwRegister(components: Record<string, any>): void;
|
||||||
|
|
|
||||||
38
packages/playwright-ct-svelte/index.d.ts
vendored
38
packages/playwright-ct-svelte/index.d.ts
vendored
|
|
@ -14,27 +14,10 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {
|
import type { Locator } from 'playwright/test';
|
||||||
TestType,
|
|
||||||
PlaywrightTestArgs,
|
|
||||||
PlaywrightTestConfig as BasePlaywrightTestConfig,
|
|
||||||
PlaywrightTestOptions,
|
|
||||||
PlaywrightWorkerArgs,
|
|
||||||
PlaywrightWorkerOptions,
|
|
||||||
Locator,
|
|
||||||
} from 'playwright/test';
|
|
||||||
import type { JsonObject } from '@playwright/experimental-ct-core/types/component';
|
import type { JsonObject } from '@playwright/experimental-ct-core/types/component';
|
||||||
import type { InlineConfig } from 'vite';
|
|
||||||
import type { SvelteComponent, ComponentProps } from 'svelte/types/runtime';
|
import type { SvelteComponent, ComponentProps } from 'svelte/types/runtime';
|
||||||
|
import type { TestType } from '@playwright/experimental-ct-core';
|
||||||
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
|
||||||
use?: BasePlaywrightTestConfig<T, W>['use'] & {
|
|
||||||
ctPort?: number;
|
|
||||||
ctTemplateDir?: string;
|
|
||||||
ctCacheDir?: string;
|
|
||||||
ctViteConfig?: InlineConfig | (() => Promise<InlineConfig>);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
type ComponentSlot = string | string[];
|
type ComponentSlot = string | string[];
|
||||||
type ComponentSlots = Record<string, ComponentSlot> & { default?: ComponentSlot };
|
type ComponentSlots = Record<string, ComponentSlot> & { default?: ComponentSlot };
|
||||||
|
|
@ -55,23 +38,12 @@ interface MountResult<Component extends SvelteComponent> extends Locator {
|
||||||
}): Promise<void>;
|
}): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ComponentFixtures {
|
export const test: TestType<{
|
||||||
mount<HooksConfig extends JsonObject, Component extends SvelteComponent = SvelteComponent>(
|
mount<HooksConfig extends JsonObject, Component extends SvelteComponent = SvelteComponent>(
|
||||||
component: new (...args: any[]) => Component,
|
component: new (...args: any[]) => Component,
|
||||||
options?: MountOptions<HooksConfig, Component>
|
options?: MountOptions<HooksConfig, Component>
|
||||||
): Promise<MountResult<Component>>;
|
): Promise<MountResult<Component>>;
|
||||||
}
|
}>;
|
||||||
|
|
||||||
export const test: TestType<
|
|
||||||
PlaywrightTestArgs & PlaywrightTestOptions & ComponentFixtures,
|
|
||||||
PlaywrightWorkerArgs & PlaywrightWorkerOptions
|
|
||||||
>;
|
|
||||||
|
|
||||||
export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig;
|
|
||||||
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
|
|
||||||
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;
|
|
||||||
export function defineConfig(config: PlaywrightTestConfig, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig;
|
|
||||||
export function defineConfig<T>(config: PlaywrightTestConfig<T>, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig<T>;
|
|
||||||
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig<T, W>;
|
|
||||||
|
|
||||||
|
export { defineConfig, PlaywrightTestConfig } from '@playwright/experimental-ct-core';
|
||||||
export { expect, devices } from 'playwright/test';
|
export { expect, devices } from 'playwright/test';
|
||||||
|
|
|
||||||
38
packages/playwright-ct-vue/index.d.ts
vendored
38
packages/playwright-ct-vue/index.d.ts
vendored
|
|
@ -14,26 +14,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {
|
import type { Locator } from 'playwright/test';
|
||||||
TestType,
|
|
||||||
PlaywrightTestArgs,
|
|
||||||
PlaywrightTestConfig as BasePlaywrightTestConfig,
|
|
||||||
PlaywrightTestOptions,
|
|
||||||
PlaywrightWorkerArgs,
|
|
||||||
PlaywrightWorkerOptions,
|
|
||||||
Locator,
|
|
||||||
} from 'playwright/test';
|
|
||||||
import type { JsonObject } from '@playwright/experimental-ct-core/types/component';
|
import type { JsonObject } from '@playwright/experimental-ct-core/types/component';
|
||||||
import type { InlineConfig } from 'vite';
|
import type { TestType } from '@playwright/experimental-ct-core';
|
||||||
|
|
||||||
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
|
||||||
use?: BasePlaywrightTestConfig<T, W>['use'] & {
|
|
||||||
ctPort?: number;
|
|
||||||
ctTemplateDir?: string;
|
|
||||||
ctCacheDir?: string;
|
|
||||||
ctViteConfig?: InlineConfig | (() => Promise<InlineConfig>);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
type ComponentSlot = string | string[];
|
type ComponentSlot = string | string[];
|
||||||
type ComponentSlots = Record<string, ComponentSlot> & { default?: ComponentSlot };
|
type ComponentSlots = Record<string, ComponentSlot> & { default?: ComponentSlot };
|
||||||
|
|
@ -71,7 +54,7 @@ interface MountResultJsx extends Locator {
|
||||||
update(component: JSX.Element): Promise<void>;
|
update(component: JSX.Element): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ComponentFixtures {
|
export const test: TestType<{
|
||||||
mount<HooksConfig extends JsonObject>(
|
mount<HooksConfig extends JsonObject>(
|
||||||
component: JSX.Element,
|
component: JSX.Element,
|
||||||
options: MountOptionsJsx<HooksConfig>
|
options: MountOptionsJsx<HooksConfig>
|
||||||
|
|
@ -80,18 +63,7 @@ export interface ComponentFixtures {
|
||||||
component: Component,
|
component: Component,
|
||||||
options?: MountOptions<HooksConfig, Component>
|
options?: MountOptions<HooksConfig, Component>
|
||||||
): Promise<MountResult<Component>>;
|
): Promise<MountResult<Component>>;
|
||||||
}
|
}>;
|
||||||
|
|
||||||
export const test: TestType<
|
|
||||||
PlaywrightTestArgs & PlaywrightTestOptions & ComponentFixtures,
|
|
||||||
PlaywrightWorkerArgs & PlaywrightWorkerOptions
|
|
||||||
>;
|
|
||||||
|
|
||||||
export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig;
|
|
||||||
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
|
|
||||||
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;
|
|
||||||
export function defineConfig(config: PlaywrightTestConfig, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig;
|
|
||||||
export function defineConfig<T>(config: PlaywrightTestConfig<T>, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig<T>;
|
|
||||||
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig<T, W>;
|
|
||||||
|
|
||||||
|
export { defineConfig, PlaywrightTestConfig } from '@playwright/experimental-ct-core';
|
||||||
export { expect, devices } from 'playwright/test';
|
export { expect, devices } from 'playwright/test';
|
||||||
|
|
|
||||||
2
packages/playwright-ct-vue/register.d.ts
vendored
2
packages/playwright-ct-vue/register.d.ts
vendored
|
|
@ -21,4 +21,4 @@ export default function pwRegister(
|
||||||
setDevtoolsHook: any,
|
setDevtoolsHook: any,
|
||||||
h: any,
|
h: any,
|
||||||
}
|
}
|
||||||
): void
|
): void;
|
||||||
|
|
|
||||||
38
packages/playwright-ct-vue2/index.d.ts
vendored
38
packages/playwright-ct-vue2/index.d.ts
vendored
|
|
@ -14,26 +14,9 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {
|
import type { Locator } from 'playwright/test';
|
||||||
TestType,
|
|
||||||
PlaywrightTestArgs,
|
|
||||||
PlaywrightTestConfig as BasePlaywrightTestConfig,
|
|
||||||
PlaywrightTestOptions,
|
|
||||||
PlaywrightWorkerArgs,
|
|
||||||
PlaywrightWorkerOptions,
|
|
||||||
Locator,
|
|
||||||
} from 'playwright/test';
|
|
||||||
import type { JsonObject } from '@playwright/experimental-ct-core/types/component';
|
import type { JsonObject } from '@playwright/experimental-ct-core/types/component';
|
||||||
import type { InlineConfig } from 'vite';
|
import type { TestType } from '@playwright/experimental-ct-core';
|
||||||
|
|
||||||
export type PlaywrightTestConfig<T = {}, W = {}> = Omit<BasePlaywrightTestConfig<T, W>, 'use'> & {
|
|
||||||
use?: BasePlaywrightTestConfig<T, W>['use'] & {
|
|
||||||
ctPort?: number;
|
|
||||||
ctTemplateDir?: string;
|
|
||||||
ctCacheDir?: string;
|
|
||||||
ctViteConfig?: InlineConfig | (() => Promise<InlineConfig>);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
type Slot = string | string[];
|
type Slot = string | string[];
|
||||||
type ComponentSlots = Record<string, Slot> & { default?: Slot };
|
type ComponentSlots = Record<string, Slot> & { default?: Slot };
|
||||||
|
|
@ -71,7 +54,7 @@ interface MountResultJsx extends Locator {
|
||||||
update(component: JSX.Element): Promise<void>;
|
update(component: JSX.Element): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ComponentFixtures {
|
export const test: TestType<{
|
||||||
mount<HooksConfig extends JsonObject>(
|
mount<HooksConfig extends JsonObject>(
|
||||||
component: JSX.Element,
|
component: JSX.Element,
|
||||||
options?: MountOptionsJsx<HooksConfig>
|
options?: MountOptionsJsx<HooksConfig>
|
||||||
|
|
@ -80,18 +63,7 @@ export interface ComponentFixtures {
|
||||||
component: Component,
|
component: Component,
|
||||||
options?: MountOptions<HooksConfig, Component>
|
options?: MountOptions<HooksConfig, Component>
|
||||||
): Promise<MountResult<Component>>;
|
): Promise<MountResult<Component>>;
|
||||||
}
|
}>;
|
||||||
|
|
||||||
export const test: TestType<
|
|
||||||
PlaywrightTestArgs & PlaywrightTestOptions & ComponentFixtures,
|
|
||||||
PlaywrightWorkerArgs & PlaywrightWorkerOptions
|
|
||||||
>;
|
|
||||||
|
|
||||||
export function defineConfig(config: PlaywrightTestConfig): PlaywrightTestConfig;
|
|
||||||
export function defineConfig<T>(config: PlaywrightTestConfig<T>): PlaywrightTestConfig<T>;
|
|
||||||
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>): PlaywrightTestConfig<T, W>;
|
|
||||||
export function defineConfig(config: PlaywrightTestConfig, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig;
|
|
||||||
export function defineConfig<T>(config: PlaywrightTestConfig<T>, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig<T>;
|
|
||||||
export function defineConfig<T, W>(config: PlaywrightTestConfig<T, W>, ...configs: PlaywrightTestConfig[]): PlaywrightTestConfig<T, W>;
|
|
||||||
|
|
||||||
|
export { defineConfig, PlaywrightTestConfig } from '@playwright/experimental-ct-core';
|
||||||
export { expect, devices } from 'playwright/test';
|
export { expect, devices } from 'playwright/test';
|
||||||
|
|
|
||||||
2
packages/playwright-ct-vue2/register.d.ts
vendored
2
packages/playwright-ct-vue2/register.d.ts
vendored
|
|
@ -21,4 +21,4 @@ export default function pwRegister(
|
||||||
setDevtoolsHook: any,
|
setDevtoolsHook: any,
|
||||||
h: any,
|
h: any,
|
||||||
}
|
}
|
||||||
): void
|
): void;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue