7cccacdc51
Implement full repository review mode that detects logical features/modules and reviews them systematically with session persistence for pause/resume capability. Key additions: - RepoScanner: scans codebase and estimates tokens/cost - FeatureAnalyzer: AI-powered detection of logical modules - FeaturePlanner: creates review execution plan - StateManager: persists sessions for resume capability - RepoOrchestrator: executes feature-by-feature reviews - MarkdownReporter: generates review reports New CLI options: --repo, --quick, --deep, --list-sessions, --session, --export, --path, --ignore, --plan-only, --reanalyze Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
46 lines
1.7 KiB
TypeScript
46 lines
1.7 KiB
TypeScript
// tests/reporter/markdown.test.ts
|
|
import { describe, it, expect } from 'vitest'
|
|
import { MarkdownReporter } from '../../src/reporter/markdown.js'
|
|
import type { RepoReviewResult, ReviewIssue } from '../../src/reporter/types.js'
|
|
|
|
describe('MarkdownReporter', () => {
|
|
it('should generate report header', () => {
|
|
const result: RepoReviewResult = {
|
|
repoName: 'test-repo',
|
|
timestamp: new Date('2026-01-26'),
|
|
stats: { totalFiles: 10, totalLines: 500, languages: { typescript: 10 }, estimatedTokens: 2000, estimatedCost: 0.02 },
|
|
architectureAnalysis: 'Good architecture',
|
|
issues: [],
|
|
tokenUsage: { total: 5000, cost: 0.05 }
|
|
}
|
|
|
|
const reporter = new MarkdownReporter()
|
|
const report = reporter.generate(result)
|
|
|
|
expect(report).toContain('# Repository Review Report: test-repo')
|
|
expect(report).toContain('10 files')
|
|
expect(report).toContain('500 lines of code')
|
|
})
|
|
|
|
it('should categorize issues by severity', () => {
|
|
const result: RepoReviewResult = {
|
|
repoName: 'test-repo',
|
|
timestamp: new Date(),
|
|
stats: { totalFiles: 1, totalLines: 100, languages: {}, estimatedTokens: 100, estimatedCost: 0.001 },
|
|
architectureAnalysis: '',
|
|
issues: [
|
|
{ id: 1, location: 'a.ts:10', description: 'SQL injection', severity: 'high', consensus: '2/2' },
|
|
{ id: 2, location: 'b.ts:20', description: 'Missing error handling', severity: 'medium', consensus: '2/2' }
|
|
],
|
|
tokenUsage: { total: 1000, cost: 0.01 }
|
|
}
|
|
|
|
const reporter = new MarkdownReporter()
|
|
const report = reporter.generate(result)
|
|
|
|
expect(report).toContain('🔴 High Priority')
|
|
expect(report).toContain('SQL injection')
|
|
expect(report).toContain('🟡 Medium Priority')
|
|
})
|
|
})
|