vitest.config.ts 730 B

123456789101112131415161718192021222324
  1. import { defineConfig } from "vitest/config";
  2. import path from "path";
  3. export default defineConfig({
  4. resolve: {
  5. // Deduplicate React so tests don't get two copies
  6. // (pnpm strict resolution can cause packages/react to resolve a different copy)
  7. alias: {
  8. react: path.resolve(__dirname, "node_modules/react"),
  9. "react-dom": path.resolve(__dirname, "node_modules/react-dom"),
  10. },
  11. },
  12. test: {
  13. globals: true,
  14. environment: "jsdom",
  15. include: ["packages/**/*.test.ts", "packages/**/*.test.tsx"],
  16. coverage: {
  17. provider: "v8",
  18. reporter: ["text", "json", "html"],
  19. include: ["packages/*/src/**/*.{ts,tsx}"],
  20. exclude: ["**/*.test.{ts,tsx}", "**/index.ts"],
  21. },
  22. },
  23. });