Skip to content

Commit

Permalink
test_runner: fix missing test diagnostics
Browse files Browse the repository at this point in the history
PR-URL: #46450
Fixes: #45911
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
MoLow authored and MylesBorins committed Feb 18, 2023
1 parent c206853 commit c526f9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/internal/test_runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions test/message/test_runner_output_cli.out
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ TAP version 13
---
duration_ms: *
...
# this test should pass
# Subtest: sync throw fail
not ok 8 - sync throw fail
---
Expand Down Expand Up @@ -204,6 +205,7 @@ TAP version 13
*
*
...
# this subtest should make its parent test fail
1..1
not ok 21 - subtest sync throw fail
---
Expand Down Expand Up @@ -365,6 +367,7 @@ TAP version 13
---
duration_ms: *
...
# \#diagnostic
# Subtest: callback pass
ok 41 - callback pass
---
Expand Down

0 comments on commit c526f9f

Please sign in to comment.