import { defineConfig } from "vitest/config"; // 组件测试一律 colocate 在 src/ 组件目录(*.test.tsx);放 test/ 下的 .test.tsx 不会被任何 project 捕获 export default defineConfig({ resolve: { alias: { "@": new URL("./src", import.meta.url).pathname } }, test: { passWithNoTests: true, projects: [ { extends: true, test: { name: "unit", include: ["test/**/*.test.ts"], environment: "node" }, }, { extends: true, test: { name: "components", include: ["src/**/*.test.tsx"], environment: "jsdom", setupFiles: ["test/setup.ts"], }, }, ], }, });