config.ts requires JWT_SECRET at module-load time. Since `.env` is gitignored it doesn't propagate to git worktrees, fresh clones, or CI without secrets — producing 200+ confusing cascade failures (vitest module-mock errors that look unrelated to the real cause). Add a vitest setupFile that sets JWT_SECRET to a fixed test-only value via `??=`, so a real .env still wins where one exists. Tests are now hermetic: clone the repo, `pnpm install`, `pnpm --filter server test` → 477/477 pass.
8 lines
137 B
TypeScript
8 lines
137 B
TypeScript
import { defineConfig } from 'vitest/config';
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
setupFiles: ['./test/setup-env.ts'],
|
|
},
|
|
});
|