Note
Automated tests are not currently implemented for this repository (package.json test script echoes an error).
This document outlines the recommended approach for testing the Circle Backend and instructions for future implementation.
- Tools: Jest or Vitest.
- Scope: Test individual Service methods and utility functions in isolation. Mock Prisma and Redis dependencies.
- Tools: Supertest with Jest.
- Scope: Test API endpoints (
/api/v1/...). Send real HTTP requests to a test instance of the app connected to a test database.
Once tests are implemented, usage will be:
npm testUntil automated tests are added, please use Swagger UI or Postman for manual verification.
- Start the server:
npm run dev - Open http://localhost:3000/api-docs
- Authenticate via the
/auth/loginendpoint. - Copy the token.
- Use the "Authorize" button in Swagger to set the Bearer token.
- Execute requests against other endpoints.