From 322de068f8a79fbcc4c7731cd46dab9659e8decf Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Fri, 22 Apr 2022 14:16:04 +0000 Subject: [PATCH] fix(test): correctly check lines, remove empty alternative --- test/reporter/TestTableReporter.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/reporter/TestTableReporter.ts b/test/reporter/TestTableReporter.ts index eea90e5..1a66328 100644 --- a/test/reporter/TestTableReporter.ts +++ b/test/reporter/TestTableReporter.ts @@ -29,9 +29,15 @@ describe('table reporter', () => { const reporter = new TableReporter(); const report = await reporter.report(results); - for (const line of report.split('\n')) { - expect(line).to.match(/^|/); + const lines = report.split('\n'); + const lastLine = lines.pop(); + + // eslint-disable-next-line no-console + console.log(lines.length, lines); + for (const line of lines) { + expect(line).to.match(/^[|]/); } + expect(lastLine).to.equal(''); }); });