0.29.1原版

This commit is contained in:
anian
2026-07-02 19:14:14 +08:00
commit d94008f0fb
947 changed files with 174905 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import react from "@vitejs/plugin-react";
import { resolve } from "path";
import { defineConfig } from "vitest/config";
// Vitest configuration. Kept separate from `vite.config.mts` so the dev/build
// pipelines stay lean and so tests can opt into jsdom + @testing-library
// without dragging them into production bundles.
export default defineConfig({
plugins: [react()],
resolve: {
// Keep in sync with the `@/` alias declared in `vite.config.mts` so that
// test-time module resolution matches production/build.
alias: {
"@/": `${resolve(__dirname, "src")}/`,
},
},
test: {
environment: "jsdom",
setupFiles: ["./tests/setup.ts"],
include: ["tests/**/*.test.{ts,tsx}"],
// Keep each test hermetic:
// - mockReset clears call history and resets implementations for vi.fn()s,
// so module-level mocks (e.g. useCurrentUser) don't leak between tests.
// - restoreMocks additionally restores original implementations for spies.
mockReset: true,
restoreMocks: true,
},
});