Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_runner: fix missing test diagnostics #46450

Merged
merged 1 commit into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;

MoLow marked this conversation as resolved.
Show resolved Hide resolved
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