From 36668302fe646772dc5ebe40782a1c6d1969966d Mon Sep 17 00:00:00 2001 From: Nazar Hussain Date: Wed, 29 Jan 2025 21:18:04 +0100 Subject: [PATCH] Fix reporter --- src/benchmark/reporter.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/benchmark/reporter.ts b/src/benchmark/reporter.ts index c3f6a2f..3613148 100644 --- a/src/benchmark/reporter.ts +++ b/src/benchmark/reporter.ts @@ -104,6 +104,29 @@ export class BenchmarkReporter { onSuiteStarted(suite: Suite): void { this.indents++; consoleLog(color("suite", "%s%s"), this.indent(), suite.name); + + if (suite.result?.state === "fail") { + consoleLog("Error loading suit.", suite.result?.errors); + + --this.indents; + consoleLog(); + return; + } + + // If the suit contains only skipped tests then runner does not start the test tasks at all + if (suite.tasks.filter((t) => t.mode !== "skip" && t.mode !== "todo").length === 0) { + for (const task of suite.tasks) { + if (task.type === "suite") { + this.onSuiteStarted(task); + } else { + this.skipped++; + consoleLog(`${this.indent()}${color("pending", " - %s")}`, task.name); + } + } + + --this.indents; + consoleLog(); + } } // eslint-disable-next-line @typescript-eslint/no-unused-vars