-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathvitest.config.ts
More file actions
61 lines (52 loc) · 1.22 KB
/
vitest.config.ts
File metadata and controls
61 lines (52 loc) · 1.22 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
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
// Enable globals like describe, it, expect
globals: true,
// Test environment
environment: "node",
// Coverage configuration
coverage: {
provider: "v8",
reporter: ["text", "json-summary", "json", "html", "lcov"],
reportsDirectory: "./coverage",
include: ["src/**/*.ts"],
exclude: [
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/__tests__/**",
"src/types.ts",
"node_modules/",
"dist/",
"coverage/",
],
thresholds: {
global: {
branches: 70,
functions: 70,
},
},
},
// Test files patterns
include: ["src/**/*.{test,spec}.{js,ts}", "tests/**/*.{test,spec}.{js,ts}"],
// Test timeout
testTimeout: 10000,
// Watch options
watch: false,
// Mock options
clearMocks: true,
restoreMocks: true,
// Reporter options
reporter: ["verbose", "json", "html"],
outputFile: {
json: "./test-results.json",
html: "./test-results/index.html",
},
},
// Resolve options for imports
resolve: {
alias: {
"@": "/src",
},
},
});