Skip to content

Commit

Permalink
Fix reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain committed Jan 29, 2025
1 parent 7640aa8 commit 3666830
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/benchmark/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3666830

Please sign in to comment.