vitest.config.ts 945 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { defineConfig } from "vitest/config";
  2. import path from "path";
  3. export default defineConfig({
  4. test: {
  5. globals: true,
  6. environment: "node",
  7. include: ["src/**/*.test.ts"],
  8. coverage: {
  9. provider: "v8",
  10. reporter: ["text", "lcov", "json-summary"],
  11. exclude: [
  12. "node_modules/",
  13. "build/",
  14. "**/*.test.ts",
  15. "scripts/",
  16. "*.config.*",
  17. ".eslintrc.cjs",
  18. ],
  19. // Coverage thresholds - fail CI if not met
  20. thresholds: {
  21. // Per-file thresholds for core modules
  22. "src/services/**/*.ts": {
  23. statements: 80,
  24. branches: 80,
  25. functions: 90,
  26. lines: 80,
  27. },
  28. "src/utils/**/*.ts": {
  29. statements: 90,
  30. branches: 75,
  31. functions: 100,
  32. lines: 90,
  33. },
  34. },
  35. },
  36. },
  37. resolve: {
  38. alias: {
  39. "@": path.resolve(__dirname, "./src"),
  40. },
  41. },
  42. });