-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvitest.config.ts
More file actions
50 lines (41 loc) · 1.3 KB
/
vitest.config.ts
File metadata and controls
50 lines (41 loc) · 1.3 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
import { defineConfig } from "vitest/config";
import path from "path";
export default defineConfig({
test: {
// Enable global test APIs (describe, it, expect, etc.)
globals: true,
// Use Node.js environment for server-side testing
environment: "node",
// Set test root directory to the new Vitest tests folder
root: "./tests",
// Setup files to run before each test file
setupFiles: ["./setup/vitest.setup.ts"],
// Global setup file to run once before all tests
globalSetup: ["./setup/global-setup.ts"],
// Global test timeout (3 minutes)
testTimeout: 180000,
// Test file patterns
include: ["**/*.test.ts"],
// Coverage configuration
coverage: {
provider: "v8",
reporter: ["text", "json", "html"],
reportsDirectory: "../coverage",
exclude: [
"**/node_modules/**",
"**/dist/**",
"**/coverage/**",
"**/setup/**",
"**/mocks/**",
"**/*.config.*",
"**/*.d.ts"
]
}
},
// Module resolution configuration
resolve: {
alias: {
"@": path.resolve(__dirname, "./api")
}
}
});