-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
41 lines (40 loc) · 1.19 KB
/
vitest.config.ts
File metadata and controls
41 lines (40 loc) · 1.19 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
/// <reference types="vitest" />
import { defineConfig } from "vitest/config";
import { resolve } from "path";
export default defineConfig({
test: {
globals: true,
environment: "node",
// Don't set root - let Vitest use the config file's directory as base
// This ensures node_modules resolution works correctly
include: ["tests/**/*.test.ts", "tests/**/*.test.js"],
// Old CLI tests have been moved to .archive/ directory
coverage: {
provider: "v8",
enabled: true,
reporter: ["text", "json", "html"],
reportsDirectory: resolve(__dirname, "./coverage"),
exclude: [
"node_modules/",
"dist/",
"**/*.config.*",
"**/bin/**",
"tests/**",
"**/*.test.ts",
"**/*.spec.ts",
],
include: ["src/**/*.ts", "!src/**/*.test.ts", "!src/**/*.spec.ts"],
all: true, // Include all files, even if not imported
// This helps track coverage even when code runs in external processes
// Note: Still limited for execSync-based tests, but better than nothing
},
},
resolve: {
alias: {
"@": resolve(__dirname, "./src"),
},
},
esbuild: {
target: "node18",
},
});