Vitest and Playwright testing patterns, conventions, and gotchas for this project.
apps/web/vite.config.ts (no separate vitest.config)npm run test from apps/web/npx vitest run path/to/file.test.tsvi.mock() is hoisted to the top of the file. You CANNOT reference variables declared above it:
// BAD — will be undefined
const mockFn = vi.fn()
vi.mock('./module', () => ({ doThing: mockFn }))
// GOOD — define inline
vi.mock('./module', () => ({ doThing: vi.fn() }))
import { doThing } from './module'
// Now doThing is the mock — use it for assertions
apps/web/playwright.config.tsapps/web/e2e/npm run test:e2e from apps/web/page.getByRole(), page.getByText() over CSS selectors