vitest.config.ts 801 B

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