-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.js
More file actions
73 lines (64 loc) · 1.66 KB
/
vitest.config.js
File metadata and controls
73 lines (64 loc) · 1.66 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
import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
import path from "path";
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
server: {
fs: {
strict: false
},
watch: {
usePolling: false,
ignored: ['**/node_modules/**', '**/.beads/**']
}
},
test: {
// Use jsdom for DOM APIs and React component testing
environment: "jsdom",
// Global setup file - runs before each test file
setupFiles: ["./src/test-utils/setup.js"],
// Enable global test APIs (describe, it, expect, vi)
globals: true,
// Include test files matching these patterns
include: ["src/**/*.{test,spec}.{js,jsx}"],
// Coverage configuration
coverage: {
provider: "v8",
reporter: ["text", "json", "json-summary", "html"],
reportsDirectory: "./coverage",
exclude: [
"node_modules/",
"src/test-utils/",
"**/*.test.{js,jsx}",
"**/*.spec.{js,jsx}",
"**/*.config.{js,mjs}",
"src/main.jsx",
"dist/",
"public/",
"services/",
],
// Coverage thresholds
thresholds: {
global: {
branches: 75,
functions: 60,
lines: 45,
statements: 45,
},
},
},
// Test timeout (10 seconds for async crypto operations)
testTimeout: 10000,
// Pool configuration for test isolation
pool: "forks",
// Reporter configuration
reporters: ["default"],
// Watch mode exclusions
watchExclude: ["node_modules/", "coverage/", ".vitest/", ".beads/"],
},
});