From b7f7a0986c5ae2a0de84183fc99daaac2f46d9e6 Mon Sep 17 00:00:00 2001 From: Raymond Oyondi Date: Sun, 12 Jul 2026 20:32:30 +0000 Subject: [PATCH] Add Playwright config to scope test discovery to e2e directory Prevents Playwright from collecting vitest unit tests (src/**/*.test.ts) as Playwright tests, which caused 'Vitest failed to access its internal state' errors and exit code 1 during npx playwright test. --- playwright.config.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 playwright.config.ts diff --git a/playwright.config.ts b/playwright.config.ts new file mode 100644 index 0000000..c89447f --- /dev/null +++ b/playwright.config.ts @@ -0,0 +1,20 @@ +import { defineConfig, devices } from '@playwright/test'; + +export default defineConfig({ + testDir: './e2e', + fullyParallel: true, + forbidOnly: !!process.env.CI, + retries: process.env.CI ? 2 : 0, + workers: process.env.CI ? 1 : undefined, + reporter: 'html', + use: { + baseURL: 'http://127.0.0.1:3000', + trace: 'on-first-retry', + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], +});