ba3ebd27f4
- Add 402 unit tests with 61.7% code coverage - Add Vitest configuration with coverage reporting - Extract testable utility functions from services - Create test.yml workflow (runs on PR and push to main) - Update docker-build.yml to require tests before building - Add scheduler-utils.ts and server-config.ts for testable code Test files added: - auth.test.ts, medications.test.ts, planner.test.ts - settings.test.ts, doses.test.ts, share.test.ts - database.test.ts, server.test.ts, services.test.ts - env.test.ts, translations.test.ts, integration.test.ts - e2e-routes.test.ts, stock-calculation.test.ts
19 lines
414 B
TypeScript
19 lines
414 B
TypeScript
import { defineConfig } from "vitest/config";
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
globals: true,
|
|
environment: "node",
|
|
include: ["src/**/*.test.ts"],
|
|
setupFiles: ["src/test/setup.ts"],
|
|
// Run tests sequentially to avoid DB conflicts
|
|
poolOptions: {
|
|
threads: {
|
|
singleThread: true,
|
|
},
|
|
},
|
|
// Timeout for longer integration tests
|
|
testTimeout: 10000,
|
|
},
|
|
});
|