feat: 项目结构重构优化

This commit is contained in:
Ray.Hao
2025-12-26 12:35:37 +08:00
parent 65ad4fe59f
commit aa374dd2ba
164 changed files with 11305 additions and 3103 deletions

43
vitest.config.ts Normal file
View 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",
// 全局测试 APIdescribe, 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"),
},
},
});