import { defineConfig } from "vitest/config";

export default defineConfig({
  test: {
    globals: true,
    environment: "node",
    include: ["test/**/*.test.ts"],
    exclude: ["node_modules", "dist"],
    testTimeout: 15000,
    hookTimeout: 30000,
    coverage: {
      provider: "v8",
      reporter: ["text", "text-summary", "lcov"],
      include: ["src/**/*.ts"],
      exclude: [
        "src/main.ts",
        "src/app.module.ts",
        "src/**/*.module.ts",
        "src/clients/**/*.ts",
        "src/dataloader/**/*.ts",
        "src/graphql/context.ts",
        "src/graphql/schema.ts",
        "src/graphql/types.ts",
        "src/graphql/yoga.ts",
        "src/graphql/resolvers/index.ts",
        "src/graphql/resolvers/me.resolver.ts",
        "src/graphql/resolvers/notification.resolver.ts",
        "src/graphql/resolvers/notification-preference.resolver.ts",
        "src/graphql/resolvers/grade.resolver.ts",
        "src/shared/cache/redis.client.ts",
        "src/shared/kafka/kafka.consumer.ts",
        "src/shared/kafka/handlers/event-handler.ts",
        "src/shared/kafka/handlers/notification-push.handler.ts",
        "src/shared/observability/logger.ts",
        "src/shared/observability/tracer.ts",
        "src/shared/errors/global-error.filter.ts",
        "src/entry/context.middleware.ts",
        "src/entry/graphql.controller.ts",
        "src/types/graphql-depth-limit.d.ts",
      ],
      thresholds: {
        statements: 80,
        branches: 80,
        functions: 80,
        lines: 80,
      },
    },
  },
  esbuild: {
    target: "es2022",
  },
});
