-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvitest.config.ts
More file actions
66 lines (65 loc) · 1.9 KB
/
vitest.config.ts
File metadata and controls
66 lines (65 loc) · 1.9 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
58
59
60
61
62
63
64
65
66
import { defineConfig } from 'vitest/config'
import * as path from 'path'
export default defineConfig({
test: {
globals: true,
environment: 'jsdom',
include: [
'src/**/*.test.{ts,tsx}', // Colocated tests in features
'src/**/*.spec.{ts,tsx}',
'tests/**/*.test.{ts,tsx}', // Tests in tests directory
'tests/**/*.spec.{ts,tsx}',
],
exclude: [
'node_modules',
'.git',
'docs',
'dist',
'coverage',
'.mastra',
'.github',
'public',
],
reporters: ['dot', 'json'],
outputFile: {
json: './tests/test-results/test-results.json',
},
testTimeout: 10000, // 10 seconds timeout
hookTimeout: 10000, // 10 seconds for setup/teardown
coverage: {
provider: 'v8',
reporter: [
'text',
'text-summary',
'html',
'json',
'json-summary',
'lcov',
],
reportsDirectory: './tests/test-results/coverage',
clean: false, // Don't clean the directory as it may be in use
reportOnFailure: true, // Generate coverage reports even when tests fail
exclude: [
'node_modules/',
'tests/',
'**/*.d.ts',
'**/*.config.*',
'**/mockData.ts',
'**/*.test.{ts,tsx}',
'src/env.d.ts',
'coverage/**',
'dist/**',
'public/**',
'**/*.stories.*',
'**/*.story.*',
],
include: ['src/**/*.{ts,tsx}'],
thresholds: {},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, '.'),
},
},
})