From a8f1273ea9b8cc58cc57a25cd39449ce26831017 Mon Sep 17 00:00:00 2001 From: Joshua Clark Date: Fri, 25 Nov 2022 11:48:59 -0700 Subject: [PATCH] feat(onRunComplete): Add timestamp to beginning of line when reporting spec results (#76) Co-authored-by: Tom M --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 926456f..32e9ee9 100644 --- a/index.js +++ b/index.js @@ -41,13 +41,14 @@ var SpecReporter = function (baseReporterDecorator, formatError, config) { } if (browsers.length >= 1 && !results.disconnected && !results.error) { + var currentTime = reporterCfg.showSpecTiming ? (this.USE_COLORS ? (new Date().toLocaleString() + ' - ').yellow : new Date().toLocaleString() + ' - ') : ''; if (!results.failed) { if (!this.suppressSummary) { - this.write(this.TOTAL_SUCCESS, results.success); + this.write(currentTime + this.TOTAL_SUCCESS, results.success); } } else { if (!this.suppressSummary) { - this.write(this.TOTAL_FAILED, results.failed, results.success); + this.write(currentTime + this.TOTAL_FAILED, results.failed, results.success); } if (!this.suppressErrorSummary) { this.logFinalErrors(this.failures);