From f9b919d01b6123b5d04f867a9c434c283ba12fee Mon Sep 17 00:00:00 2001 From: Moshe Atlow Date: Tue, 31 Jan 2023 21:52:25 +0200 Subject: [PATCH] test_runner: fix missing test diagnostics --- lib/internal/test_runner/runner.js | 5 ++++- test/message/test_runner_output_cli.out | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/internal/test_runner/runner.js b/lib/internal/test_runner/runner.js index 7ef91cf036a94f..39670ccabd3b3c 100644 --- a/lib/internal/test_runner/runner.js +++ b/lib/internal/test_runner/runner.js @@ -140,9 +140,12 @@ class FileTest extends Test { return secondSpaceIndex === -1 && ArrayPrototypeIncludes(kDiagnosticsFilterArgs, StringPrototypeSlice(comment, 0, firstSpaceIndex)); } - #handleReportItem({ kind, node, nesting = 0 }) { + #handleReportItem({ kind, node, comments, nesting = 0 }) { nesting += 1; + if (comments) { + ArrayPrototypeForEach(comments, (comment) => this.reporter.diagnostic(nesting, this.name, comment)); + } switch (kind) { case TokenKind.TAP_VERSION: // TODO(manekinekko): handle TAP version coming from the parser. diff --git a/test/message/test_runner_output_cli.out b/test/message/test_runner_output_cli.out index 525f8db3c885e3..cc9c07f4c5c409 100644 --- a/test/message/test_runner_output_cli.out +++ b/test/message/test_runner_output_cli.out @@ -57,6 +57,7 @@ TAP version 13 --- duration_ms: * ... + # this test should pass # Subtest: sync throw fail not ok 8 - sync throw fail --- @@ -204,6 +205,7 @@ TAP version 13 * * ... + # this subtest should make its parent test fail 1..1 not ok 21 - subtest sync throw fail --- @@ -365,6 +367,7 @@ TAP version 13 --- duration_ms: * ... + # \#diagnostic # Subtest: callback pass ok 41 - callback pass ---