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
Backport-PR-URL: #46839
Fixes: #45911
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
  • Loading branch information
MoLow authored and juanarbol committed Mar 5, 2023
1 parent c5f16fb commit ba784e8
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 @@ -139,9 +139,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 ba784e8

Please sign in to comment.