-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvitest.config.ts
More file actions
57 lines (53 loc) · 1.46 KB
/
vitest.config.ts
File metadata and controls
57 lines (53 loc) · 1.46 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { defineConfig } from 'vitest/config'
import { resolve } from 'node:path'
import { config as loadEnv } from 'dotenv'
import { existsSync } from 'node:fs'
const envPath = resolve(__dirname, '.env')
if (existsSync(envPath)) {
loadEnv({ path: envPath, override: true })
console.log('[vitest] Loaded environment variables from .env')
} else {
console.warn('[vitest] Warning: .env file not found at', envPath)
}
const currentEnv = { ...process.env }
export default defineConfig({
test: {
globals: true,
environment: 'node',
silent: false,
include: ['packages/**/tests/**/*.{test,bench}.ts'],
exclude: ['node_modules', 'dist', '**/*.d.ts'],
testTimeout: 300000,
hookTimeout: 180000,
env: currentEnv,
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html', 'lcov'],
include: ['packages/*/src/**/*.ts'],
exclude: [
'packages/*/src/**/*.test.ts',
'packages/*/src/**/*.spec.ts',
'packages/*/src/**/*.bench.ts',
'packages/*/dist/**',
'**/types/**',
'**/*.d.ts'
],
thresholds: {
lines: 80,
functions: 80,
branches: 75,
statements: 80
}
},
benchmark: {
include: ['packages/**/tests/**/*.bench.ts'],
exclude: ['node_modules', 'dist'],
}
},
resolve: {
alias: {
'@sdk': resolve(__dirname, 'packages/sdk/src'),
'@shared': resolve(__dirname, 'packages/shared/src')
}
}
})