vitest.config.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import path from "path"
  2. import { defineConfig } from "vitest/config"
  3. export default defineConfig({
  4. test: {
  5. globals: true,
  6. environment: "node",
  7. coverage: {
  8. reporter: ["text", "json", "html"],
  9. exclude: ["node_modules/", "dist/"],
  10. },
  11. projects: [
  12. {
  13. extends: true,
  14. test: {
  15. name: "unit",
  16. include: ["src/**/*.test.{ts,tsx}", "tests/**/*.test.{ts,tsx}"],
  17. exclude: ["src/**/*.markdown.test.tsx"],
  18. },
  19. },
  20. {
  21. extends: true,
  22. test: {
  23. name: "markdown",
  24. include: ["src/**/*.markdown.test.tsx"],
  25. env: { FORCE_COLOR: "3" },
  26. },
  27. },
  28. ],
  29. },
  30. resolve: {
  31. alias: {
  32. vscode: path.resolve(__dirname, "src/vscode-shim.ts"),
  33. // Match tsconfig paths - baseUrl is parent directory
  34. "@": path.resolve(__dirname, "../src"),
  35. "@api": path.resolve(__dirname, "../src/core/api"),
  36. "@core": path.resolve(__dirname, "../src/core"),
  37. "@generated": path.resolve(__dirname, "../src/generated"),
  38. "@hosts": path.resolve(__dirname, "../src/hosts"),
  39. "@integrations": path.resolve(__dirname, "../src/integrations"),
  40. "@packages": path.resolve(__dirname, "../src/packages"),
  41. "@services": path.resolve(__dirname, "../src/services"),
  42. "@shared": path.resolve(__dirname, "../src/shared"),
  43. "@utils": path.resolve(__dirname, "../src/utils"),
  44. },
  45. },
  46. })