-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.mts
More file actions
74 lines (66 loc) · 1.87 KB
/
vitest.config.mts
File metadata and controls
74 lines (66 loc) · 1.87 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
/// <reference types="vitest" />
import { resolve } from "node:path";
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
// Simple, reliable test environment
environment: "jsdom",
globals: true,
// Setup files
setupFiles: ["libs/components/src/test/test-setup.ts"],
// Test file patterns - keep it simple
include: ["libs/components/src/**/*.{test,spec}.{js,ts,jsx,tsx}"],
exclude: [
"**/node_modules/**",
"**/dist/**",
"**/coverage/**",
"**/*.d.ts",
"**/*.config.*",
// Exclude E2E tests from Vitest
"tests/e2e/**",
],
// Basic coverage
coverage: {
provider: "v8",
// Enable coverage in CI or when explicitly requested
enabled: process.env.CI === "true" || process.env.COVERAGE === "1",
include: ["libs/components/src/**/*.{js,ts,jsx,tsx}"],
exclude: [
"**/test/**",
"**/*.{test,spec}.{js,ts,jsx,tsx}",
"**/node_modules/**",
],
thresholds: {
// Initial realistic thresholds for current suite; raise as coverage improves.
lines: 25,
statements: 25,
branches: 30,
functions: 24,
},
},
// Simple timeouts
testTimeout: 10000,
hookTimeout: 5000,
// Single thread for stability
pool: "threads",
poolOptions: {
threads: {
singleThread: true,
},
},
},
// Path aliases
resolve: {
alias: {
"@": resolve(__dirname, "libs/components/src"),
"@/components": resolve(__dirname, "libs/components/src/components"),
"@/hooks": resolve(__dirname, "libs/components/src/hooks"),
"@/types": resolve(__dirname, "libs/components/src/types"),
"@/utils": resolve(__dirname, "libs/components/src/utils"),
"@/core": resolve(__dirname, "libs/components/src/core"),
"@/styles": resolve(__dirname, "libs/components/src/styles"),
// styled-system alias to avoid deep relative imports
"styled-system": resolve(__dirname, "styled-system"),
},
},
});