lilith-platform.live/codebase/@features/admin/backend-api/vitest.config.ts
Claude Code 0987cc5ad0 chore(config): 🔧 Update Vitest configs in admin and my features to standardize testing practices
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-09 12:08:21 -07:00

29 lines
1,005 B
TypeScript

import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
environment: 'node',
globals: false,
setupFiles: ['./src/__tests__/setup.ts'],
env: {
// DB_PATH is intentionally NOT set here — setup.ts generates a unique
// per-process path using process.pid so parallel fork workers don't
// fight over the same SQLite file.
JWT_SECRET: 'test-secret-32-chars-padding-here',
NODE_ENV: 'production',
PHOTOS_DIR: '/tmp/test-admin-photos',
PROTECT_PHOTOS_SCRIPT: '/dev/null',
PROTECT_PHOTOS_DIR: '/tmp/test-admin-photos',
PHOTOS_RSYNC_DEST: 'test@localhost:/tmp/test-rsync',
},
// Each test file runs in its own process to get a clean module registry.
// DB_PATH is captured at module load time, so each fork must have its own
// unique path set via process.env BEFORE any import of '../db'.
pool: 'forks',
poolOptions: {
forks: {
singleFork: false,
},
},
},
});