feat: add API unit tests
Add Bun test suite covering: - Auth: register, login, duplicate email, invalid password - Events: create, location, validation, unauthorized - Journals: get, generate, delete, list with pagination - Settings: get, update, clear prompt, change password - Export/Import: export data, events with location - Search: search events, no matches, cross-date - Days: list days, get day details, empty day
This commit is contained in:
@@ -18,6 +18,7 @@ Self-hosted journaling app where users capture events throughout the day and AI
|
||||
/src
|
||||
index.ts # Main API routes, journal generation logic
|
||||
/services/ai # AI provider implementations (Groq, OpenAI, Anthropic, Ollama, LMStudio)
|
||||
/__tests__/ # API unit tests (Bun test)
|
||||
|
||||
/frontend
|
||||
/src
|
||||
@@ -191,6 +192,13 @@ bunx prisma migrate dev --name migration_name
|
||||
docker compose build && docker compose up -d
|
||||
```
|
||||
|
||||
### Running Tests
|
||||
```bash
|
||||
cd backend
|
||||
bun run test:server
|
||||
```
|
||||
Tests require the server running. The test script starts the server, runs tests, then stops it.
|
||||
|
||||
## Version History
|
||||
- 0.1.0: Automatic geolocation capture, Starlight documentation site
|
||||
- 0.0.6: Automatic geolocation capture on event creation, reverse geocoding to place names
|
||||
|
||||
Reference in New Issue
Block a user