Files
flyer-crawler.projectium.com/docs/adr/0010-testing-strategy-and-standards.md
Torben Sorensen d004efb84b
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 16m21s
testing ADR - architectural decisions
2025-12-12 10:57:49 -08:00

1.4 KiB

ADR-010: Testing Strategy and Standards

Date: 2025-12-12

Status: Proposed

Context

The project has a good foundation of unit and integration tests. However, there is no formal document defining the scope, purpose, and expected coverage for different types of tests. This can lead to inconsistent testing quality and gaps in coverage.

Decision

We will formalize the testing pyramid for the project, defining the role of each testing layer:

  1. Unit Tests (Vitest): For isolated functions, components, and repository methods with mocked dependencies. High coverage is expected.
  2. Integration Tests (Supertest): For API routes, testing the interaction between controllers, services, and mocked database layers. Focus on contract and middleware correctness.
  3. End-to-End (E2E) Tests (Playwright/Cypress): For critical user flows (e.g., login, flyer upload, checkout), running against a real browser and a test database to ensure the entire system works together.

Consequences

Positive: Ensures a consistent and comprehensive approach to quality assurance. Gives developers confidence when refactoring or adding new features. Clearly defines "done" for a new feature. Negative: May require investment in setting up and maintaining the E2E testing environment. Can slightly increase the time required to develop a feature if all test layers are required.