mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 04:40:09 +00:00
Add backend unit test framework and modularize settings UI
Introduced a Vitest-based backend unit testing framework with supporting scripts, helpers, and GitHub Actions integration. Refactored the admin settings page to a modular architecture, splitting monolithic logic into feature-specific tabs and hooks for improved maintainability and testability. Updated documentation to reflect the new testing setup and settings architecture, and added new dependencies for testing utilities.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
# Testing
|
||||
|
||||
**Status:** ⏳ In Progress | Backend unit testing framework (Vitest)
|
||||
|
||||
## Overview
|
||||
Unit tests for backend logic with isolated mocks (Prisma, integrations, queue).
|
||||
|
||||
## Key Details
|
||||
- **Runner:** Vitest (`vitest.config.ts`, Node environment)
|
||||
- **Setup:** `tests/setup.ts` sets `NODE_ENV=test`, `TZ=UTC`, blocks unmocked fetch
|
||||
- **Helpers:** `tests/helpers/prisma.ts`, `tests/helpers/job-queue.ts`
|
||||
- **GitHub Actions:** Manual workflow `.github/workflows/manual-tests.yml` runs `npm test`
|
||||
- **Coverage:** `npm run test:coverage` (reports in `coverage/`)
|
||||
- **Scope:** Backend unit tests only; no real network or services
|
||||
|
||||
## API/Interfaces
|
||||
```
|
||||
npm run test
|
||||
npm run test:watch
|
||||
npm run test:coverage
|
||||
```
|
||||
|
||||
## Critical Issues
|
||||
- API route unit tests are incomplete; add route-level mocks before enforcing coverage.
|
||||
|
||||
## Related
|
||||
- [backend/services/jobs.md](backend/services/jobs.md)
|
||||
- [backend/services/scheduler.md](backend/services/scheduler.md)
|
||||
Reference in New Issue
Block a user