UNPKG

@n1k1t/unit-generator

Version:

Coverage based unit tests AI generator

37 lines 1.54 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const dotenv_1 = __importDefault(require("dotenv")); const config = dotenv_1.default.config(); const extract = ((name, fallback) => { if (config.parsed?.[name]?.length) { return config.parsed[name]; } if (process.env[name]?.length) { return process.env[name]; } return fallback; }); exports.default = { key: extract('UNIT_GENERATOR_API_KEY'), url: extract('UNIT_GENERATOR_API_URL'), model: extract('UNIT_GENERATOR_MODEL') ?? 'gemini-flash-latest', provider: extract('UNIT_GENERATOR_PROVIDER'), command: extract('UNIT_GENERATOR_TEST_COMMAND') ?? 'npm test', cobertura: extract('UNIT_GENERATOR_COBERTURA_PATH') ?? 'coverage/cobertura-coverage.xml', iterations: Number(extract('UNIT_GENERATOR_MAX_ITERATIONS') ?? 5), target: Number(extract('UNIT_GENERATOR_COVERAGE_TARGET') ?? 0.8), marker: extract('UNIT_GENERATOR_MARKER') ?? '/* Generated by @n1k1t/unit-generator */', parallel: Boolean(JSON.parse(extract('UNIT_GENERATOR_PARALLEL') ?? 'true')), debug: Boolean(JSON.parse(extract('UNIT_GENERATOR_DEBUG') ?? 'false')), langfuse: { url: extract('LANGFUSE_BASE_URL'), keys: { public: extract('LANGFUSE_PUBLIC_KEY'), secret: extract('LANGFUSE_SECRET_KEY'), }, }, }; //# sourceMappingURL=env.js.map