Codebase
Tests
End-to-end (E2E) tests using Playwright for browser-based acceptance testing.
Tests Directory
End-to-end (E2E) tests using Playwright for browser-based acceptance testing.
What This Directory Contains
This directory contains integration and E2E tests that run against the full application in a browser environment. These tests verify that features work correctly from a user's perspective.
Why Tests Are Organized This Way
The test suite is split across two locations for different purposes:
| Location | Test Type | Purpose |
|---|---|---|
src/**/*.test.ts | Unit tests | Co-located with source, test individual functions |
src/__tests__/ | Test utilities | Helpers, fixtures, code quality checks |
tests/e2e/ | E2E tests | Browser-based acceptance tests |
Directory Structure
tests/
βββ e2e/
βββ acceptance.spec.ts # Core user flow tests
βββ accessibility.spec.ts # WCAG compliance tests
βββ edge-cases.spec.ts # Error handling and edge cases
βββ theme-toggle.spec.ts # Dark mode functionality
βββ global-setup.ts # Playwright setup
βββ fixtures/ # Test fixtures and mocks
β βββ api-mocks.ts # API response mocks
βββ helpers/ # Test helper utilities
βββ form-interaction.ts # Form interaction helpers
How to Run Tests
All Tests
# Run unit + integration tests
bun test
# Run E2E tests
bun test:e2e
# Run everything
bun test && bun test:e2e
E2E Tests Only
# Run all E2E tests
bun test:e2e
# Run specific test file
bun test:e2e tests/e2e/acceptance.spec.ts
# Run in headed mode (see the browser)
bun test:e2e --headed
# Run with Playwright UI
bun test:e2e --ui
# Run specific browser
bun test:e2e --project=chromium
bun test:e2e --project=firefox
bun test:e2e --project=webkit
Unit Tests Only
# Run all unit tests
bun test
# Run domain tests
bun test src/domain
# Run adapter tests
bun test src/adapters
# Run with coverage
bun test:coverage
# Watch mode
bun test --watch
Test Coverage
The project maintains high test coverage:
| Layer | Line Coverage | Target |
|---|---|---|
| Domain | 100% | 100% |
| Adapters | 99.5% | 90% |
| Lib | 100% | 100% |
| Overall | 99.97% | 95% |
Run coverage report:
bun test:coverage
Related Documentation
e2e/README.md- Detailed E2E testing guide../src/__tests__/README.md- Test utilities and code quality checks../src/__tests__/helpers/README.md- Fake services and test data generators