Skip to content
flexcal Documentation

Testing

Vitest, always with a fixed timezone so date assertions behave the same everywhere:

Terminal window
TZ=UTC bun run test

A single file:

Terminal window
TZ=UTC bunx vitest run path/to/file.test.ts

Type errors are frequently the root cause of test failures, so check types first:

Terminal window
bun run type-check:ci --force

Playwright. Set NEXTAUTH_URL to the URL the app actually serves — http://localhost:3000 locally, as .env.example describes.

Terminal window
bun run test-e2e

Open the last HTML report:

Terminal window
bunx playwright show-report test-results/reports/playwright-html-report
Executable doesn't exist at .../ms-playwright/chromium-1048/chrome-mac/Chromium.app/...

Download them:

Terminal window
bunx playwright install

Tests that assert on outgoing mail need MailHog running and E2E_TEST_MAILHOG_ENABLED=1:

Terminal window
docker run -d -p 8025:8025 -p 1025:1025 mailhog/mailhog