From 7f64e58b37c0e9ce227fe93219ea3ba29ef7ca1c Mon Sep 17 00:00:00 2001 From: Roger Chappel Date: Mon, 1 Jun 2026 21:52:06 +1000 Subject: [PATCH] fix: render file report table once --- src/reporter.test.ts | 21 +++++++++++++++++++++ src/reporter.ts | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/reporter.test.ts b/src/reporter.test.ts index 758f450..d5bc31c 100644 --- a/src/reporter.test.ts +++ b/src/reporter.test.ts @@ -92,6 +92,27 @@ describe('generateReport', () => { // Should list implicit and any issues expect(output).toMatch(/\bimplicit\b|\bany\b/i); }); + + it('renders one file table border around all file rows', () => { + const result = makeResult(); + result.files.push({ + file: 'other.ts', + total: 1, + annotated: 1, + anyCount: 0, + unknownCount: 0, + implicitCount: 0, + coverage: 100, + nodes: [], + }); + + const { output } = generateReport(result, { format: 'text' }); + + expect(output.match(/┌/g)).toHaveLength(1); + expect(output.match(/└/g)).toHaveLength(1); + expect(output).toContain('test.ts'); + expect(output).toContain('other.ts'); + }); }); describe('saveBaseline / loadBaseline', () => { diff --git a/src/reporter.ts b/src/reporter.ts index 1e70f54..94d3916 100644 --- a/src/reporter.ts +++ b/src/reporter.ts @@ -153,8 +153,8 @@ function formatText(result: ProjectResult, options: ReportOptions = {}): string const issuesStr = issues.length > 0 ? pc.red(` (${issues.join(', ')})`) : pc.green(' ✓'); lines.push(` ${pc.dim('│')} ${cov.padEnd(8)} ${relPath + issuesStr}`); - lines.push(` ${pc.dim('└' + '─'.repeat(60) + '┘')}`); } + lines.push(` ${pc.dim('└' + '─'.repeat(60) + '┘')}`); lines.push(''); }