Testing
This document describes the testing strategy for the project, including frameworks, test organization, and best practices.
Test Frameworks
- The project uses Jest (or another framework, e.g., React Testing Library, Cypress) for unit and integration tests.
- End-to-end (E2E) tests may use Cypress or Playwright (if configured).
Where to Put Tests
- Unit and integration tests go in
src/__tests__/or alongside components asComponentName.test.tsx. - E2E tests go in
e2e/orcypress/(if present).
Running Tests
- Run all tests:bash
npm run test - Run tests in watch mode:bash
npm run test:watch - Run E2E tests (if configured):bash
npm run test:e2e
Best Practices
- Write tests for all new features and bug fixes.
- Use descriptive test names and clear assertions.
- Mock external dependencies (APIs, Firestore, etc.) as needed.
- Keep tests isolated and independent.
- Update or remove tests when refactoring code.
- Aim for high coverage, but prioritize meaningful tests over 100% coverage.
For more, see ARCHITECTURE.md or ask a maintainer.