Replaced singleFork:true + sequence config with the simpler fileParallelism:false which correctly serializes test file execution. The previous singleFork approach ran tests from multiple files concurrently within one process, allowing the global afterEach cleanup (test/setup.ts: truncates lists/listShares) to delete rows mid-test in another file, causing intermittent FK violations (ER_DUP_ENTRY, ER_NO_REFERENCED_ROW). fileParallelism:false runs one test file at a time so afterEach cleanup for file A never races with insertions from file B.
15 lines
520 B
TypeScript
15 lines
520 B
TypeScript
import { defineConfig } from 'vitest/config'
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
environment: 'node',
|
|
globals: true,
|
|
setupFiles: ['./test/setup.ts'],
|
|
// Disable parallel file execution so concurrent DB tests do not interfere
|
|
// via the shared MariaDB. The global afterEach in test/setup.ts truncates
|
|
// list tables; running test files in parallel causes FK violations when one
|
|
// file's afterEach deletes rows that another file's test is still using.
|
|
fileParallelism: false,
|
|
},
|
|
})
|