diff --git a/lib/internal/test_runner/runner.js b/lib/internal/test_runner/runner.js index 602f6a5..898d319 100644 --- a/lib/internal/test_runner/runner.js +++ b/lib/internal/test_runner/runner.js @@ -1,4 +1,4 @@ -// https://github.com/nodejs/node/blob/61c65b066b098cf47f89206212864ec1cddb8782/lib/internal/test_runner/runner.js +// https://github.com/nodejs/node/blob/1118db718c8429f5f343aca90ccb570244e282b4/lib/internal/test_runner/runner.js 'use strict' const { ArrayFrom, @@ -134,9 +134,12 @@ class FileTest extends Test { 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 c0e39ec..74b3ef7 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 ---