From c6602bcbe846befb09b6eb3d91b1c66ce5781ae9 Mon Sep 17 00:00:00 2001 From: shankar0123 Date: Wed, 13 May 2026 20:44:07 +0000 Subject: [PATCH] fix(ci): exclude Playwright e2e specs from Vitest run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Phase 3 Playwright harness stub landed web/src/__tests__/e2e/smoke.spec.ts using @playwright/test's test.describe(). Vitest's default include glob ('**/*.{test,spec}.{js,...}') matches that file and tries to execute it under jsdom, but test.describe() from Playwright throws: Error: Playwright Test did not expect test.describe() to be called here. The Frontend Build CI job (npm run test → vitest run) hits this on every push. Fix: extend the Vitest exclude list to skip src/__tests__/e2e/**. Playwright still runs them via 'npm run e2e' against web/playwright.config.ts (testDir './src/__tests__/e2e'). Verified locally that fast-glob matches the file at that pattern. configDefaults imported from 'vitest/config' preserves Vitest's own default excludes (node_modules + .git) alongside the addition. --- web/vite.config.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/vite.config.ts b/web/vite.config.ts index 3a06a84..5c16797 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -1,4 +1,5 @@ import { defineConfig } from 'vite' +import { configDefaults } from 'vitest/config' import react from '@vitejs/plugin-react' // C-1 closure (cat-u-vite_dev_proxy_plaintext_drift): pre-C-1 the dev @@ -25,5 +26,11 @@ export default defineConfig({ globals: true, environment: 'jsdom', setupFiles: ['./src/test/setup.ts'], + // Exclude Playwright e2e specs from the Vitest run. The harness in + // src/__tests__/e2e/ uses @playwright/test's test.describe(), which + // throws "did not expect test.describe() to be called here" under + // Vitest. Playwright runs them via `npm run e2e` against + // web/playwright.config.ts (testDir: './src/__tests__/e2e'). + exclude: [...configDefaults.exclude, 'src/__tests__/e2e/**'], }, })