# Testing Guide ## Framework Jest (backend), Vitest (frontend) ## Test Structure ``` tests/ ├── unit/ # Unit tests ├── integration/ # Integration tests └── e2e/ # End-to-end tests ``` ## Running Tests ```bash # Run all tests npm run test # Run with coverage npm run test -- --coverage # Run specific test file npm run test -- path/to/test.ts ``` ## Coverage Requirements - Minimum 80% coverage - All public APIs must be tested - All error paths must be tested ## Test Patterns - Arrange-Act-Assert pattern - One assertion per test when possible - Descriptive test names - Mock external dependencies