-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.mts
More file actions
66 lines (63 loc) · 1.65 KB
/
Copy pathvitest.config.mts
File metadata and controls
66 lines (63 loc) · 1.65 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
import path from 'path';
import { fileURLToPath } from 'url';
import { defineConfig } from 'vitest/config';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({
test: {
// Global coverage configuration
coverage: {
reporter: ['text', 'html'],
provider: 'v8',
reportsDirectory: 'coverage',
include: [
'apps/**/src/**/*.{ts,tsx}',
'packages/**/src/**/*.{ts,tsx}'
],
exclude: [
'**/__tests__/**',
'**/*.{test,spec}.{ts,tsx}',
'**/node_modules/**',
'**/dist/**',
'**/build/**'
]
},
// Use projects instead of environmentMatchGlobs (deprecated in v4)
projects: [
{
test: {
name: 'node-tests',
environment: 'node',
setupFiles: ['tests/vitest.setup.ts'],
include: [
'apps/server/src/**/*.{test,spec}.{ts,tsx}',
'apps/desktop/src/**/*.{test,spec}.{ts,tsx}',
'packages/**/src/**/*.{test,spec}.{ts,tsx}'
],
exclude: [
'**/*.integration.test.{ts,tsx}'
]
},
resolve: {
alias: {
'@crocdesk/shared': path.resolve(__dirname, 'packages/shared/src')
}
}
},
{
test: {
name: 'web-tests',
environment: 'jsdom',
setupFiles: ['tests/vitest.setup.ts'],
include: [
'apps/web/src/**/*.{test,spec}.{ts,tsx}'
]
},
resolve: {
alias: {
'@crocdesk/shared': path.resolve(__dirname, 'packages/shared/src')
}
}
}
]
}
});