-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
44 lines (42 loc) · 1.38 KB
/
vitest.config.ts
File metadata and controls
44 lines (42 loc) · 1.38 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
import { defineConfig } from 'vitest/config';
const isIntegrationTest = process.env.RUNNING_INTEGRATION_TESTS === 'true';
export default defineConfig({
test: {
globals: true, // To use describe, it, etc. without importing them in every file
environment: 'jsdom', // Use JSDOM environment to provide DOM APIs like document
testTimeout: 10000, // テストタイムアウトを10秒に設定
env: {
NODE_ENV: 'test'
},
include: isIntegrationTest
? ['test/integration/**/*.test.ts'] // 統合テスト実行時
: [ // 通常時
'test/**/*.test.ts',
'!test/integration/**/*.test.ts',
],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html'], // Common reporters
reportsDirectory: './coverage',
include: [
'src/**/*.ts'
],
exclude: [
'src/types.ts', // Type definitions are usually not part of coverage metrics
'**/node_modules/**',
'**/dist/**',
'**/test/**',
'**/*.test.ts',
'ref/**', // Exclude the entire ref directory
'vitest.config.ts' // Exclude the config file itself
],
all: true, // Show coverage for all included files, even if no tests cover them
// thresholds: {
// lines: 80,
// functions: 80,
// branches: 80,
// statements: 80,
// },
},
},
});