feat: initial dev-configs monorepo
Shared configs for TypeScript projects: ESLint, Prettier, TypeScript, Vite, Jest, Playwright, Knip. Published as @vigdorov/* npm packages to Gitea registry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
29
packages/playwright/src/index.ts
Normal file
29
packages/playwright/src/index.ts
Normal file
@ -0,0 +1,29 @@
|
||||
import type {PlaywrightTestConfig} from '@playwright/test';
|
||||
|
||||
export interface PlaywrightConfigOptions {
|
||||
baseURL: string;
|
||||
testDir?: string;
|
||||
retries?: number;
|
||||
}
|
||||
|
||||
export function playwrightConfig(options: PlaywrightConfigOptions): PlaywrightTestConfig {
|
||||
const {baseURL, testDir = 'e2e', retries} = options;
|
||||
const isCI = !!process.env.CI;
|
||||
|
||||
return {
|
||||
testDir,
|
||||
timeout: 30_000,
|
||||
retries: retries ?? (isCI ? 2 : 0),
|
||||
reporter: isCI ? 'html' : 'list',
|
||||
use: {
|
||||
baseURL,
|
||||
trace: 'on-first-retry',
|
||||
screenshot: 'only-on-failure',
|
||||
},
|
||||
projects: [
|
||||
{name: 'chromium', use: {browserName: 'chromium'}},
|
||||
{name: 'firefox', use: {browserName: 'firefox'}},
|
||||
{name: 'webkit', use: {browserName: 'webkit'}},
|
||||
],
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user