-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.js
More file actions
41 lines (38 loc) · 1.11 KB
/
vitest.config.js
File metadata and controls
41 lines (38 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import path from 'path'
import { loadEnv } from 'payload/node'
import { fileURLToPath } from 'url'
import tsconfigPaths from 'vite-tsconfig-paths'
import { defineConfig } from 'vitest/config'
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
export default defineConfig(() => {
loadEnv(path.resolve(dirname, './dev'))
return {
plugins: [
tsconfigPaths({
ignoreConfigErrors: true,
}),
],
test: {
environment: 'node',
hookTimeout: 30_000,
testTimeout: 30_000,
include: ['dev/tests/int/**/*.int.spec.ts'],
exclude: ['dev/tests/e2e/**/*.e2e.spec.ts'],
// Run tests sequentially to avoid SQLite database locking issues
pool: 'forks',
poolOptions: {
forks: {
singleFork: true,
},
},
// Also ensure test files run sequentially
fileParallelism: false,
// Use separate SQLite files for tests (storage + event bus)
env: {
SYNC_STATE_DB_PATH: './dev/tests/test-sync-state.db',
EVENT_BUS_DB_PATH: './dev/tests/test-event-bus.db',
},
},
}
})