import { defineConfig } from "vitest/config";

export const nodeVitestConfig = defineConfig({
  test: {
    globals: true,
    environment: "node",
    include: ["src/**/*.test.ts", "tests/**/*.test.ts"],
    setupFiles: ["@repo/core-testing/setup/node"],
    clearMocks: true,
    restoreMocks: true,
    mockReset: true,
    unstubGlobals: true,
    sequence: { shuffle: true },
    coverage: {
      provider: "v8",
      reporter: ["text", "html", "lcov"],
      include: ["src/**"],
      exclude: [
        "src/**/*.test.{ts,tsx}",
        "src/**/index.ts",
        "src/__factories__/**",
        "src/__contracts__/**",
      ],
      thresholds: {
        statements: 80, branches: 75, functions: 80, lines: 80,
      },
    },
  },
});
