import { TestResult, TrendReport, PerformanceBaseline as PerformanceBaselineType, CoverageReport } from '../../types/reporting'; import { TrendAnalyzer } from './TrendAnalyzer'; import { PerformanceBaseline } from './PerformanceBaseline'; export class EnhancedTestReporter { private results: TestResult[] = []; private trendAnalyzer: TrendAnalyzer; private performanceBaseline: PerformanceBaseline; constructor() { this.trendAnalyzer = new TrendAnalyzer(); this.performanceBaseline = new PerformanceBaseline(); } addResult(result: TestResult): void { this.results.push(result); } generateTrendReport(): TrendReport { return this.trendAnalyzer.analyze(this.results); } generatePerformanceBaseline(): PerformanceBaselineType { return this.performanceBaseline.calculate(this.results); } generateCoverageReport(): CoverageReport { const totalTests = this.results.length; const passed = this.results.filter(r => r.status === 'passed').length; const failed = this.results.filter(r => r.status === 'failed').length; const skipped = this.results.filter(r => r.status === 'skipped').length; return { totalTests, passed, failed, skipped }; } getResults(): TestResult[] { return this.results; } clearResults(): void { this.results = []; } }