/** * Test Repairer * * Orchestrates the automatic test repair process. */ import type { TestError, FixSuggestion, RepairAnalysis, TestRepairResult, RepairOptions } from './types.js'; import { type FixerOptions } from './engine/fixer.js'; export interface RepairerOptions extends RepairOptions { fixer?: FixerOptions; maxIterations?: number; onProgress?: (progress: RepairProgress) => void; } export interface RepairProgress { stage: 'analyzing' | 'suggesting' | 'applying' | 'verifying' | 'complete'; message: string; iteration?: number; fixesApplied?: number; errorsRemaining?: number; } export interface RepairReport { analysis: RepairAnalysis; result: TestRepairResult; duration: number; success: boolean; } /** * Main test repairer orchestrator */ export declare class TestRepairer { private options; private iteration; constructor(options?: RepairerOptions); /** * Analyze test failures and generate repair suggestions */ analyze(testFile: string, testResults?: TestRunResult): Promise; /** * Repair tests automatically */ repair(testFile: string, testResults: TestRunResult): Promise; /** * Get quick fixes without LLM */ getQuickFixes(testFile: string, error: TestError): Promise; /** * Generate repair report */ generateReport(report: RepairReport): string; /** * Read test code from file */ private readTestCode; /** * Infer source file path from test file path */ private inferSourcePath; /** * Extract errors from test file (basic implementation) */ private extractErrorsFromTestFile; /** * Simulate test rerun (for demonstration) */ private simulateRerun; /** * Calculate repair priority */ private calculatePriority; /** * Emit progress callback */ private emitProgress; } /** * Test run result */ export interface TestRunResult { passed: number; failed: number; errors: TestError[]; duration: number; } /** * Analyze test errors from raw output */ export declare function analyzeTestErrors(testFile: string, errorOutput: string): Promise; /** * Create repair report in JSON format */ export declare function createRepairJSONReport(report: RepairReport): string;