-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
47 lines (46 loc) · 1.4 KB
/
vitest.config.ts
File metadata and controls
47 lines (46 loc) · 1.4 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
import { defineConfig } from "vitest/config";
import { fileURLToPath } from "node:url";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react()],
test: {
globals: true,
environment: "jsdom", // Use jsdom for React component testing
setupFiles: ["./src/test-utils/setup.ts"],
include: ["src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
exclude: ["node_modules", "dist", "src-tauri", "**/backup/**"],
coverage: {
provider: "v8",
reporter: ["text", "json", "html"],
include: ["src/**/*.{ts,tsx}"],
exclude: [
"node_modules/",
"dist/",
"src-tauri/",
"seeds/",
"scripts/",
"src/test-utils/",
"**/*.spec.ts",
"**/*.test.ts",
"**/*.spec.tsx",
"**/*.test.tsx",
"**/*.d.ts",
"**/*.config.{js,ts}",
"**/vite-env.d.ts",
"src/main.tsx",
],
},
},
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
"@components": fileURLToPath(
new URL("./src/components", import.meta.url),
),
"@lib": fileURLToPath(new URL("./src/lib", import.meta.url)),
"@hooks": fileURLToPath(new URL("./src/hooks", import.meta.url)),
"@types": fileURLToPath(new URL("./src/types", import.meta.url)),
"@utils": fileURLToPath(new URL("./src/utils", import.meta.url)),
},
},
});