- Unit (Jest): utils, hooks (
use-orchestration-like), rules helpers - Component (React Testing Library): forms, dialogs
- E2E (Playwright): auth flows, role routing, jobs CRUD, Stripe demo path
- Rules (Emulator): allow/deny matrices for users/jobs/applications
npm run test:unitβ Jest unit/component testsnpm run test:unit:watchβ Jest with watch mode for developmentnpm run test:unit:coverageβ Generate coverage reportnpm run test:e2eβ Playwright E2E tests (requires server on :3000)npm run test:e2e:uiβ Playwright UI mode (interactive debugging)npm run test:e2e:headedβ Run tests with visible browsernpm run test:e2e:debugβ Playwright debugger (step-through mode)npm run test:a11yβ Accessibility tests (axe-core via Playwright)
npm run lintβ ESLint + TypeScript checksnpm run buildβ Production build (includes TypeScript compilation)
Firestore security rules are tested locally via Firebase emulators:
# Install Firebase Tools globally (one-time setup)
npm install -g firebase-tools
# Start Firestore emulator
firebase emulators:start --only firestore
# In another terminal, run tests that interact with Firestore
npm run test:unit
# Stop emulators: Ctrl+CNote: Most unit tests use mocked Firebase services. Emulator testing is primarily for validating Firestore security rules behavior.
First-Load JS Budget (β€ 300 KB):
- Measured via Playwright in headless Chromium
- Counts only JavaScript loaded on initial page visit
- Excludes prefetch requests and Next.js data fetches
- Reports compressed bytes (what users actually download)
- Script:
scripts/ci/measure-first-load.mjs - Local test:
FIRST_LOAD_BUDGET_KB=300 node scripts/ci/measure-first-load.mjs - CI artifact:
first-load-report.json(uploaded on every build)
Lighthouse Budgets (lighthouse-budgets.json):
- Script: β€ 300 KB
- Stylesheet: β€ 50 KB
- Total resources: β€ 1024 KB (1 MB)
- Time to Interactive: β€ 5000ms
- First Contentful Paint: β€ 2000ms
Axe-core Automated Testing:
- Zero tolerance for WCAG violations
- Tests 3 critical pages:
/,/dashboard,/subscribe - Runs in CI on every PR
- Reports uploaded as artifacts
- Uses
@axe-core/playwrightfor accurate browser context
Manual Accessibility Checklist:
- Keyboard navigation works (Tab, Enter, Escape)
- Screen reader announces all interactive elements
- Color contrast meets WCAG AA (4.5:1 text, 3:1 UI)
- Focus indicators visible on all focusable elements
- Forms have proper labels and error messages