Files
ReadMeABook/documentation/testing.md
T
kikootwo 94dbaf073b 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.
2026-01-28 11:41:59 -05:00

948 B

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.