This repository was archived by the owner on Oct 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
What to test
Zoka-tech edited this page Mar 30, 2025
·
5 revisions
Each layer has different responsibilities and therefore different things to test.
This section gives you an overview of what kind of logic, behavior, and edge cases should be covered in Storage, Service, and Server tests.
Even if files are not part of a layer, if they perform important tasks, they should still be tested.
- Database operations (CRUD)
- Data relationships and foreign keys (e.g. Tree ↔ TreeCluster)
- Transactions and rollback behavior
- Handling of constraint violations
- Behavior when context is canceled
- Core business logic
- Correct use of repository interfaces
- Aggregation and calculation logic
- Behavior on repository errors (error handling/fail paths)
- HTTP routing and endpoint behavior
- Request validation (e.g. query params, body data)
- Response formats and status codes
- Middleware behavior (e.g. pagination)
- Reactions to invalid or missing input