-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
51 lines (50 loc) · 1.27 KB
/
vitest.config.ts
File metadata and controls
51 lines (50 loc) · 1.27 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
/// <reference types="vitest/config" />
import react from "@vitejs/plugin-react";
import path from "path";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [react()],
define: {
__APP_VERSION__: JSON.stringify("test"),
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
"@shared": path.resolve(__dirname, "./shared"),
"@server": path.resolve(__dirname, "./server"),
},
},
test: {
globals: true,
environment: "jsdom",
setupFiles: ["./tests/setup.ts"],
include: [
"src/**/*.test.{ts,tsx}",
"server/**/*.test.ts",
"shared/**/*.test.ts",
"tests/**/*.test.{ts,tsx}",
],
// 临时排除 @lobehub/ui ESM 兼容性问题的测试文件(第三方包 bug)
exclude: [
"**/node_modules/**",
"**/dist/**",
"**/cypress/**",
"**/.{bay,cy,comm}ardrc.{js,ts}",
"**/{bay,bundle,cypress,dist,hot,normalized,output,story,tsOut,var}/**",
"**/TargetForm.test.tsx",
],
coverage: {
provider: "v8",
reporter: ["text", "json", "html"],
exclude: [
"node_modules/",
"tests/",
"**/*.d.ts",
"**/*.config.*",
"**/types/**",
"dist/",
"dist-server/",
],
},
},
});