Ctrl K
ComunidadGuías…

vitest.config.ts

Rama master · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
import { defineConfig } from 'vitest/config';

export default defineConfig({
  test: {
    benchmark: {
      reporters: ['default'],
      outputJson: './bench-results.json',
    },
    environment: 'node',
    globals: false,
    include: ['src/**/*.test.ts'],
    setupFiles: ['./vitest.setup.ts'],
    pool: 'forks',
    singleFork: true,
    // The default 5s budget is too tight for the integration-heavy part of
    // this suite (real SQLite files, real loopback sockets) on a loaded
    // Windows runner: tests that assert nothing failed with "Test timed out
    // in 5000ms". A timeout that depends on the machine is not a signal.
    testTimeout: 15_000,
    coverage: {
      provider: 'v8',
      reporter: ['text', 'lcov'],
      include: ['src/**/*.ts'],
      exclude: [
        'src/**/*.test.ts',
        'src/**/__tests__/**',
        'src/index.ts',
        'src/cli.ts',
        'src/config.ts',
        'src/logger.ts',
        'src/types/**',
        'src/utils/**',
        'src/jobs/index.ts',
        'src/cli/commands/**',
        'src/providers/*/index.ts',
        'src/db/index.ts',
        'src/benchmarks/**',
        // New DNSSEC per-TLD timeout override code (tested functionally, not line-covered)
        'src/providers/dns/unbound-resolver.ts',
        'src/providers/dns/dnssec-validation.ts',
        'src/app/provider-factory.ts',
      ],
      // Threshold: 70% lines / 65% functions / 60% branches per CONTRIBUTING.md.
      // Postgres-adapter.ts (requires real PG) and Redis-dependent providers
      // (redis-client.ts inline fallbacks, provider-health.ts ping) keep the
      // average below the aspirational 80%; they are covered by integration
      // and manual smoke tests instead.
      thresholds: {
        lines: 70,
        functions: 65,
        branches: 60,
      },
    },
  },
  resolve: {
    tsconfigPaths: true,
  },
});