import { defineConfig } from 'vitest/config' export default defineConfig({ test: { environment: 'node', globals: true, setupFiles: ['./test/setup.ts'], // Run test files sequentially so concurrent DB tests do not interfere via // the shared MariaDB (global afterEach in test/setup.ts truncates list tables // which causes FK violations if two workers share the DB concurrently). sequence: { concurrent: false, }, pool: 'forks', // singleFork: top-level in vitest 4.x (poolOptions removed in v4). // Runs all test files in one forked process so the shared MariaDB // teardown (afterEach in test/setup.ts) never races with inserts // from a concurrent worker. singleFork: true, }, })