Testing & CI
Backend
Section titled “Backend”cd backendnpm testUses Node’s built-in test runner (node:test) and supertest. Each test file gets a fresh temporary data directory and database. The suites cover authentication and rate limiting, access control between users, sharing roles, validation, migrations from the original schema, backups, demo data, reminders, dose tracking, parasite treatments, conditions, costs, the vet directory, account preferences, the calendar feed, the email digest (with a fake transport) and pet export/import.
Frontend
Section titled “Frontend”cd frontendnpm testUses Vitest for the pure helpers in src/utils/: date formatting (including time-zone edge cases), lab value and range parsing, chart ticks, vaccine status, the dose-frequency parser, expenses and timeline grouping, and money formatting.
Continuous integration
Section titled “Continuous integration”.github/workflows/ci.yml runs on every push to main and on pull requests:
- backend tests,
- frontend tests (with
TZ=America/Bogota, a negative UTC offset that catches date bugs) and a production build, - a Docker build and smoke test: start the container, wait for
/api/auth/config, check that the SPA is served.