test(frontend): component testing infra (jsdom + testing-library + vitest projects)

This commit is contained in:
2026-09-15 11:46:20 +08:00
parent 147339083b
commit ca419410b4
4 changed files with 715 additions and 1 deletions
+18 -1
View File
@@ -2,5 +2,22 @@ import { defineConfig } from "vitest/config";
export default defineConfig({
resolve: { alias: { "@": new URL("./src", import.meta.url).pathname } },
test: { include: ["test/**/*.test.ts", "test/**/*.test.tsx"], passWithNoTests: true },
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"],
},
},
],
},
});