From 6cefab534403e3329d6cb43f563291a8f24e0699 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Mon, 5 Mar 2018 15:59:34 -0500 Subject: [PATCH] progtest: Output trailing newline after summary line * src/reporter/ConsoleTestReporter.js (createSummaryLine): Output trailing newline. * test/reporter/ConsoleTestReporterTest.js: Modify respective test. --- progtest/src/reporter/ConsoleTestReporter.js | 2 +- progtest/test/reporter/ConsoleTestReporterTest.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/progtest/src/reporter/ConsoleTestReporter.js b/progtest/src/reporter/ConsoleTestReporter.js index 45302bd3..a6648e3c 100644 --- a/progtest/src/reporter/ConsoleTestReporter.js +++ b/progtest/src/reporter/ConsoleTestReporter.js @@ -280,6 +280,6 @@ module.exports = Class( 'ConsoleTestReporter', 'virtual protected createSummaryLine'( test_total, failed, acount, afailed ) { return `\n${test_total} tests, ${failed} failed (` + - `${acount} assertions, ${afailed} failures)`; + `${acount} assertions, ${afailed} failures)\n`; }, } ); diff --git a/progtest/test/reporter/ConsoleTestReporterTest.js b/progtest/test/reporter/ConsoleTestReporterTest.js index 07e3e52c..c7fa459c 100644 --- a/progtest/test/reporter/ConsoleTestReporterTest.js +++ b/progtest/test/reporter/ConsoleTestReporterTest.js @@ -166,12 +166,13 @@ describe( "ConsoleTestReporter", () => const lines = output.split( '\n' ); // preceded by empty line - expect( lines[ lines.length - 2 ] ).to.equal( "" ); + expect( lines[ lines.length - 3 ] ).to.equal( "" ); // last line - expect( lines[ lines.length - 1 ] ).to.equal( + expect( lines[ lines.length - 2 ] ).to.equal( `5 tests, 2 failed (15 assertions, 3 failures)` ); + expect( lines[ lines.length - 1 ] ).to.equal( "" ); } ); } ); } );