初始化提交
This commit is contained in:
commit
887c1f449e
963 files changed
+166869
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { defineConfig } from "vitest/config";
|
||||
|
||||
/**
|
||||
* Vitest 配置。
|
||||
* - environment=jsdom:支持组件渲染测试;纯函数测试同样兼容。
|
||||
* - globals=true:直接使用 describe/it/expect,无需逐文件 import。
|
||||
* - alias @/* → src/*:与 tsconfig paths 一致。
|
||||
*/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
||||
},
|
||||
},
|
||||
test: {
|
||||
environment: "jsdom",
|
||||
globals: true,
|
||||
setupFiles: ["./src/test/setup.ts"],
|
||||
include: ["src/**/*.{test,spec}.{ts,tsx}"],
|
||||
coverage: {
|
||||
provider: "v8",
|
||||
reporter: ["text", "html"],
|
||||
include: ["src/lib/**", "src/components/**"],
|
||||
exclude: ["src/**/*.test.{ts,tsx}", "src/test/**"],
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user