feat: 项目结构重构优化
This commit is contained in:
43
vitest.config.ts
Normal file
43
vitest.config.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import { defineConfig } from "vitest/config";
|
||||
import vue from "@vitejs/plugin-vue";
|
||||
import { resolve } from "path";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
test: {
|
||||
// 使用 happy-dom 作为测试环境(比 jsdom 快)
|
||||
environment: "happy-dom",
|
||||
|
||||
// 全局测试 API(describe, it, expect 等)
|
||||
globals: true,
|
||||
|
||||
// 测试环境设置文件
|
||||
setupFiles: ["./tests/setup.ts"],
|
||||
|
||||
// 覆盖率配置
|
||||
coverage: {
|
||||
provider: "v8",
|
||||
reporter: ["text", "json", "html"],
|
||||
exclude: [
|
||||
"node_modules/",
|
||||
"tests/",
|
||||
"**/*.d.ts",
|
||||
"**/*.config.*",
|
||||
"**/mockData",
|
||||
"**/.{idea,git,cache,output,temp}",
|
||||
],
|
||||
},
|
||||
|
||||
// 测试文件匹配规则
|
||||
include: ["tests/**/*.{test,spec}.{js,ts}"],
|
||||
|
||||
// 测试超时时间
|
||||
testTimeout: 10000,
|
||||
},
|
||||
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": resolve(__dirname, "./src"),
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user