Skip to main content
Borrissol’s test suite is split across two complementary tools: Playwright handles end-to-end browser tests that exercise the real built site in a real browser, and Vitest handles component-level unit tests. The two suites run independently and cover different layers of the codebase — Playwright verifies user-facing behaviour across Desktop and Mobile Chrome, while Vitest targets isolated component logic in src/.

Run commands

E2E tests always run against a production build. The test:e2e and test:e2e:ui scripts call npm run build first — the Playwright suite never exercises the Astro dev server.

Playwright E2E test scope

The Playwright suite (test files in ./tests/) covers the four critical user journeys on the production build:

Playwright configuration

Playwright is configured in playwright.config.ts. Key settings extracted from the file: Browser targets — two projects:
Web server configuration: Playwright spins up npm run preview -- --port 4334 and waits for http://localhost:4334 before running tests. Port 4334 is intentionally different from the Astro dev server (4321) to avoid conflicts during local development.
CI behaviour:

Vitest unit test scope

Vitest is configured in vitest.config.ts using getViteConfig from astro/config — this ensures the Vite build context matches the Astro project exactly:
Unit tests live alongside their source files in src/. The current suite includes component tests such as Button.test.ts. Add new *.test.ts files anywhere under src/ and Vitest will pick them up automatically.

Important rules for contributors

Do not run tests automatically. Tests (Vitest and Playwright) must only be run when explicitly requested. During the UI build phase, prioritise visual accuracy in the browser over terminal test results.
After every significant UI change, use the dev server for manual verification first: npm run dev → open http://localhost:4321 → confirm the result looks correct. Then, when a full test pass is needed, run the explicit test commands above.
The project’s CLAUDE.md establishes three related rules that apply to contributors and AI agents alike:
  1. No automatic testing — never trigger vitest or playwright test as a side-effect of another task.
  2. Manual verification first — after any significant change, provide the dev server URL and ask the human to confirm visual correctness before running the automated suite.
  3. E2E = production build only — Playwright always needs a built dist/. Never point it at the dev server.