- Add exclude: ['e2e/**', 'node_modules/**'] to vitest.config.ts test block to prevent Playwright specs from being picked up by Vitest jsdom runner - Add tsconfig.e2e.json extending main tsconfig with node types for playwright.config.ts and e2e/**/* typecheck coverage - Add @types/node to pwa devDependencies (required by playwright.config.ts) - Update typecheck script to run both src and e2e tsc passes - 191 unit tests still pass; no e2e import errors in vitest run
20 lines
848 B
TypeScript
20 lines
848 B
TypeScript
import { defineConfig } from 'vitest/config'
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
environment: 'jsdom',
|
|
globals: true,
|
|
setupFiles: ['./src/test-setup.ts'],
|
|
// Pin test runner timezone to UTC so WR-05 date-extraction tests are deterministic
|
|
// regardless of the developer's local machine zone or CI runner zone.
|
|
// With TZ=UTC, new Date('2026-06-10T23:30:00-04:00').getFullYear() etc. return the
|
|
// UTC wall-clock values, making assertions stable across EDT/PST/UTC environments.
|
|
env: { TZ: 'UTC' },
|
|
// Prevent Vitest's default **/*.{test,spec}.ts glob from picking up
|
|
// apps/pwa/e2e/*.spec.ts files, which import @playwright/test APIs
|
|
// (devices, etc.) that are not available in the jsdom environment.
|
|
// See Phase 7 RESEARCH.md §Pitfall 1.
|
|
exclude: ['e2e/**', 'node_modules/**'],
|
|
},
|
|
})
|