-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
52 lines (46 loc) · 1.65 KB
/
vitest.config.ts
File metadata and controls
52 lines (46 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
// vitest.config.ts
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
// Run tests within Node.js (can change to 'jsdom' later if needed for DOM APIs)
environment: 'node',
// environment: 'jsdom', // Use this if you need browser globals like document/window
// Look for test files in all packages
include: ['packages/*/src/**/*.{test,spec}.{ts,tsx}'],
// Exclude node_modules, dist, etc.
exclude: ['**/node_modules/**', '**/dist/**', '**/coverage/**'],
// Optional: Global setup file (similar to jest.setup.js if needed)
setupFiles: './vitest.setup.ts', // Create this file if you need global setup
globals: true, // Enable global variables like `describe`, `it`, etc.
// Coverage configuration
coverage: {
provider: 'v8', // or 'istanbul'
reporter: ['text', 'json', 'html', 'lcov', 'clover'],
reportsDirectory: './coverage',
include: ['packages/*/src/**/*.{ts,tsx}'],
exclude: [
// Same exclusions as before
'**/node_modules/**',
'**/dist/**',
'**/coverage/**',
'**/__tests__/**', // Exclude test files themselves
'**/*.{test,spec}.{ts,tsx}',
'packages/*/src/**/*.d.ts',
'packages/*/src/**/index.ts',
'packages/*/src/**/types.ts',
'packages/*/src/**/_internal/**',
],
// Optional: Thresholds
// thresholds: {
// lines: 5,
// functions: 5,
// branches: 5,
// statements: 5,
// },
},
// Optional: Alias configuration if needed for imports
// alias: {
// '@react-api-kit/core': './packages/core/src',
// }
},
});