Files
wehub-resource-sync 3a28426bf4
Lint and Format Check / lint-and-format (push) Failing after 0s
Check Migrations / Check for duplicate migration numbers (push) Failing after 1s
CI Pre-merge Check / CI Pre-merge Check (push) Failing after 2m17s
chore: import upstream snapshot with attribution
2026-07-13 12:23:40 +08:00

37 lines
1.3 KiB
TypeScript

import { configDefaults, defineConfig } from 'vitest/config';
import path from 'path';
import { fileURLToPath } from 'url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@insforge/shared-schemas': path.resolve(__dirname, '../packages/shared-schemas/src'),
},
},
test: {
environment: 'node',
globals: true,
setupFiles: ['./tests/setup.ts'],
exclude: [...configDefaults.exclude, 'tests/integration/**'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: ['node_modules/', 'dist/', 'frontend/', 'tests/', '**/*.d.ts', '**/*.config.*'],
},
testTimeout: 10000,
// Run tests sequentially to avoid database conflicts. Vitest 4 removed
// poolOptions.forks.singleFork; `maxWorkers: 1` reproduces it here: a
// single worker runs test files one at a time. Isolation stays at its
// default (true) — matching v3 `singleFork: true`, which shared the fork
// process but still reset module state per file. (`isolate: false` is
// intentionally NOT set: it breaks tests that rely on per-file module
// resets, e.g. function-security and smtp-link-validation.)
pool: 'forks',
maxWorkers: 1,
},
});