-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvitest.config.js
More file actions
32 lines (29 loc) · 926 Bytes
/
vitest.config.js
File metadata and controls
32 lines (29 loc) · 926 Bytes
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
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/specs/**/*.spec.ts'],
exclude: ['**/e2e.spec.{ts,js}', '**/node_modules/**'],
// Each test file gets its own forked process so memory is fully
// reclaimed between files (prevents OOM on CI).
pool: 'forks',
// Run test files sequentially to avoid DB / global-state interference.
fileParallelism: false,
},
}
})