-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
76 lines (71 loc) · 1.97 KB
/
Copy pathvitest.config.ts
File metadata and controls
76 lines (71 loc) · 1.97 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
67
68
69
70
71
72
73
74
75
76
import path from 'path';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vitest/config';
export default defineConfig({
plugins: [react()],
test: {
globals: true, // Enables global APIs (describe, it, expect)
environment: 'jsdom',
setupFiles: ['./vitest.setup.ts'],
include: ['__tests__/**/*.{test,spec}.{ts,tsx}'],
exclude: ['**/node_modules/**', '**/.next/**', '__tests__/setup/**', '**/engine/**'],
unstubEnvs: true,
unstubGlobals: true,
coverage: {
provider: 'v8', // Faster than istanbul
include: [
'lib/**/*.{js,jsx,ts,tsx}',
'hooks/**/*.{js,jsx,ts,tsx}',
'components/ui/**/*.{js,jsx,ts,tsx}',
'app/(logged-out)/home/**/*.{js,jsx,ts,tsx}',
],
exclude: [
// Core business logic exclusions
'lib/db/**',
'lib/email/**',
'lib/auth/user-sync.ts',
'lib/billing/operations.ts',
'lib/billing/stripe-sync.ts',
'lib/billing/cron-sync.ts',
'lib/billing/subscription.ts',
'lib/storage.ts',
// API routes
'app/api/**',
// Complex components
'components/app-sidebar.tsx',
'components/skeletons.tsx',
'components/ui/sidebar.tsx',
'components/ui/chart.tsx',
'components/ui/calendar.tsx',
'components/ui/carousel.tsx',
// Standard exclusions
'**/*.d.ts',
'**/node_modules/**',
'**/.next/**',
'**/coverage/**',
'vitest.config.ts',
'vitest.setup.ts',
'tailwind.config.ts',
'postcss.config.*',
'next.config.ts',
'drizzle.config.ts',
'**/__tests__/**',
'**/cli/**',
'instrumentation*.ts',
'proxy.ts',
'sentry.*.ts',
],
thresholds: {
lines: 95,
functions: 85,
branches: 90,
statements: 90,
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './'),
},
},
});