import { defineConfig } from "vitest/config";
import path from "node:path";

export default defineConfig({
  esbuild: {
    jsx: "automatic",
  },
  test: {
    environment: "node",
    include: ["lib/**/*.test.ts", "tests/**/*.test.ts", "tests/**/*.test.tsx"],
    environmentMatchGlobs: [["tests/ui/**", "jsdom"]],
    setupFiles: ["./tests/ui/setup.ts"],
    coverage: {
      provider: "v8",
      include: ["lib/farmer-routing.ts", "lib/farmer-dashboard.ts"],
      thresholds: {
        branches: 90,
      },
    },
  },
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "."),
    },
  },
});
