- Raise use-swipe-gesture mutation score to 66.13% (target 65%+) - Maintain use-reduced-motion mutation score at 76.32% (target 50%+) - Fix use-reduced-motion.ts ESLint set-state-in-effect warning - Add UJ-10 deep searcher journey (category browse → article read → content discovery) - Add 40 new test files (analytics, detail, sections, ui, lib components) - Update test-strategy-plan.md to v2.0 (sync test count to 1591) - Sync README.md with final release metrics Quality gates: TS 0 errors, ESLint 0 errors, 121 suites / 1591 tests passed
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
// @ts-nocheck
|
|
import { TestResult, TrendReport, Trend } from '../../types/reporting';
|
|
|
|
export class TrendAnalyzer {
|
|
analyze(results: TestResult[]): TrendReport {
|
|
return {
|
|
totalTests: results.length,
|
|
passRate: this.calculatePassRate(results),
|
|
averageDuration: this.calculateAverageDuration(results),
|
|
trends: this.calculateTrends(results)
|
|
};
|
|
}
|
|
|
|
private calculatePassRate(results: TestResult[]): number {
|
|
const passed = results.filter(r => r.status === 'passed').length;
|
|
return (passed / results.length) * 100;
|
|
}
|
|
|
|
private calculateAverageDuration(results: TestResult[]): number {
|
|
const totalDuration = results.reduce((sum, r) => sum + r.duration, 0);
|
|
return totalDuration / results.length;
|
|
}
|
|
|
|
private calculateTrends(results: TestResult[]): Trend[] {
|
|
const trends: Trend[] = [];
|
|
const now = new Date();
|
|
|
|
trends.push({
|
|
date: now.toISOString(),
|
|
passRate: this.calculatePassRate(results),
|
|
duration: this.calculateAverageDuration(results)
|
|
});
|
|
|
|
return trends;
|
|
}
|
|
}
|