-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvitest.config.ts
More file actions
38 lines (36 loc) · 966 Bytes
/
vitest.config.ts
File metadata and controls
38 lines (36 loc) · 966 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
33
34
35
36
37
38
import dotenv from 'dotenv';
import path from 'path';
import { defineConfig } from 'vitest/config';
// Load .env.test for integration tests
dotenv.config({ path: path.resolve(__dirname, '.env.test') });
export default defineConfig({
resolve: {
alias: {
'@auth': path.resolve(__dirname, 'src/auth'),
'@utils': path.resolve(__dirname, 'src/utils'),
},
},
test: {
globals: true,
environment: 'node',
reporters: 'verbose',
include: ['test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
exclude: ['node_modules', 'dist'],
setupFiles: ['test/setup.ts'],
fileParallelism: false, // Run test files sequentially to avoid build race conditions
env: {
NODE_ENV: 'test',
},
testTimeout: 30000,
hookTimeout: 30000,
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'],
exclude: [
'node_modules/',
'dist/',
'test/',
],
},
},
});