Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Commit

Permalink
chore: remove vite as dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
sand4rt committed Jan 17, 2024
1 parent f1b3c2c commit 7cc3d72
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 32 deletions.
35 changes: 5 additions & 30 deletions playwright-ct-angular/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,10 @@
* limitations under the License.
*/

import type {
TestType,
PlaywrightTestArgs,
PlaywrightTestConfig as BasePlaywrightTestConfig,
PlaywrightTestOptions,
PlaywrightWorkerArgs,
PlaywrightWorkerOptions,
Locator,
} from '@playwright/test';
import type { Locator } from '@playwright/test';
import type { JsonObject } from '@playwright/experimental-ct-core/types/component';
import type { InlineConfig } from 'vite';
import type { Type } from '@angular/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>);
};
};
import type { TestType } from '@playwright/experimental-ct-core';

type ComponentSlot = string | string[];
type ComponentSlots = Record<string, ComponentSlot> & { default?: ComponentSlot };
Expand All @@ -56,20 +39,12 @@ interface MountResult<Component> extends Locator {
}): Promise<void>;
}

export interface ComponentFixtures {
export const test: TestType<{
mount<HooksConfig extends JsonObject, Component = unknown>(
component: Type<Component>,
options?: MountOptions<HooksConfig, 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 { defineConfig, PlaywrightTestConfig } from '@playwright/experimental-ct-core';
export { expect, devices } from '@playwright/test';
3 changes: 1 addition & 2 deletions playwright-ct-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
"dependencies": {
"@analogjs/vite-plugin-angular": "0.2.28",
"@angular-devkit/build-angular": "^16.1.0",
"@playwright/experimental-ct-core": "1.41.0",
"vite": "^4.4.9"
"@playwright/experimental-ct-core": "1.41.0"
},
"devDependencies": {
"@angular/animations": "^16.1.7",
Expand Down

0 comments on commit 7cc3d72

Please sign in to comment.