Testing
Unit tests
Section titled “Unit tests”Vitest, always with a fixed timezone so date assertions behave the same everywhere:
TZ=UTC bun run testA single file:
TZ=UTC bunx vitest run path/to/file.test.tsType checking
Section titled “Type checking”Type errors are frequently the root cause of test failures, so check types first:
bun run type-check:ci --forceEnd-to-end tests
Section titled “End-to-end tests”Playwright. Set NEXTAUTH_URL to the URL the app actually serves — http://localhost:3000 locally,
as .env.example describes.
bun run test-e2eOpen the last HTML report:
bunx playwright show-report test-results/reports/playwright-html-reportBrowsers not installed
Section titled “Browsers not installed”Executable doesn't exist at .../ms-playwright/chromium-1048/chrome-mac/Chromium.app/...Download them:
bunx playwright installEmail assertions
Section titled “Email assertions”Tests that assert on outgoing mail need MailHog running and E2E_TEST_MAILHOG_ENABLED=1:
docker run -d -p 8025:8025 -p 1025:1025 mailhog/mailhog