import { defineConfig } from "vitest/config";

export default defineConfig({
  test: {
    globals: true,
    watch: false,
    exclude: ["**/fixtures/**", "**/dist/**"],
    poolOptions: {
      threads: {
        maxThreads: 8,
      },
    },
    clearMocks: true,
    testTimeout: 30_000,
    coverage: {
      enabled: true,
      provider: "v8",
      reportsDirectory: "coverage",
      reporter: ["lcov", "cobertura"],
      clean: true,
    },
    reporters: ["default", ["junit", { outputFile: "test-report.xml" }]],
    environment: "node",
    pool: "threads",
    projects: [
      {
        test: {
          include: [
            "**/test/*.test.ts",
            "**/test/processor/*.test.ts",
            "**/test/traces/*.test.ts",
            "**/test/internals/*.test.ts",
            "**/test/exporter/*.test.ts",
          ],
          name: "unit",
        },
      },
      {
        test: {
          include: ["**/test/integration/*.test.ts"],
          name: "integration",
        },
      },
    ],
  },
});
