import { defineConfig } from "vitest/config"; export default defineConfig({ test: { environment: "node", // Each server suite boots + tears down its own embedded Postgres in // beforeAll/afterAll. Under the loaded serial shard (maxWorkers=1) the // graceful shutdown can occasionally cross vitest's default 10s hookTimeout, // producing flaky "Hook timed out in 10000ms" afterAll failures on CI. Give // the boot/teardown hooks generous headroom; 30s is far above the observed // worst-case teardown yet still catches a genuinely hung hook. teardownTimeout // mirrors it for the same reason. hookTimeout: 30000, teardownTimeout: 30000, isolate: true, maxConcurrency: 1, maxWorkers: 1, minWorkers: 1, pool: "forks", sequence: { concurrent: false, hooks: "list", }, setupFiles: ["./src/__tests__/setup-supertest.ts"], }, });