import { defaultCoverageExclusions, defaultThresholds, mergeConfigs, mergeThresholds, } from "./base.js";
// Re-export base utilities for entry-point configs
export { defaultCoverageExclusions, defaultThresholds, mergeConfigs, mergeThresholds, };
/**
 * NestJS-specific patterns excluded from coverage collection.
 * These are generated or boilerplate files that don't benefit from coverage tracking.
 */
const nestjsCoverageExclusions = [
    ...defaultCoverageExclusions,
    "!**/*.entity.ts",
    "!**/*.dto.ts",
    "!**/*.input.ts",
    "!**/*.args.ts",
    "!**/*.model.ts",
    "!**/*.module.ts",
    "!**/*.factory.ts",
    "!**/*.enum.ts",
    "!**/*.interface.ts",
    "!**/*.constants.ts",
    "!**/database/migrations/**",
    "!**/database/seeds/**",
    "!**/graphql/**",
    "!**/main.ts",
];
/**
 * Creates a Jest configuration for NestJS projects.
 * @param options - Configuration options for threshold overrides
 * @param options.thresholds - Coverage thresholds (merged defaults + project overrides)
 * @returns Jest config object with ts-jest transform, node environment, and NestJS-specific exclusions
 * @remarks NestJS projects use CommonJS modules and spec.ts test file convention.
 * Uses tsconfig.spec.json for ts-jest diagnostics because the main tsconfig.json
 * excludes spec files from compilation — without this, path aliases used only in
 * test files (e.g. @test-utils) fail to resolve during type checking.
 * Coverage excludes entities, DTOs, modules, and other boilerplate files
 * that are better validated through integration tests.
 */
export const getNestjsJestConfig = ({ thresholds = defaultThresholds, } = {}) => ({
    testEnvironment: "node",
    rootDir: "src",
    testRegex: ".*\\.spec\\.ts$",
    transform: {
        "^.+\\.ts$": ["ts-jest", { tsconfig: "tsconfig.spec.json" }],
    },
    moduleFileExtensions: ["js", "json", "ts"],
    collectCoverageFrom: ["**/*.ts", ...nestjsCoverageExclusions],
    ...(thresholds !== undefined ? { coverageThreshold: thresholds } : {}),
    testTimeout: 10000,
});
//# sourceMappingURL=nestjs.js.map