2
0

vitest.quota.config.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import path from "node:path";
  2. import { defineConfig } from "vitest/config";
  3. export default defineConfig({
  4. test: {
  5. globals: true,
  6. environment: "node",
  7. setupFiles: ["./tests/setup.ts"],
  8. include: [
  9. "tests/unit/lib/rate-limit/**/*.{test,spec}.ts",
  10. "tests/unit/proxy/rate-limit-guard.test.ts",
  11. ],
  12. exclude: ["node_modules", ".next", "dist", "build", "coverage", "tests/integration/**"],
  13. coverage: {
  14. provider: "v8",
  15. reporter: ["text", "html", "json"],
  16. reportsDirectory: "./coverage-quota",
  17. include: ["src/lib/rate-limit/**", "src/app/v1/_lib/proxy/rate-limit-guard.ts"],
  18. exclude: ["node_modules/", "tests/", "**/*.d.ts", ".next/", "src/lib/rate-limit/index.ts"],
  19. thresholds: {
  20. lines: 80,
  21. functions: 80,
  22. branches: 70,
  23. statements: 80,
  24. },
  25. },
  26. reporters: ["verbose"],
  27. isolate: true,
  28. mockReset: true,
  29. restoreMocks: true,
  30. clearMocks: true,
  31. },
  32. resolve: {
  33. alias: {
  34. "@": path.resolve(__dirname, "./src"),
  35. "server-only": path.resolve(__dirname, "./tests/server-only.mock.ts"),
  36. },
  37. },
  38. });