Skip to content

Commit ba784e8

Browse files
MoLowjuanarbol
authored andcommittedMar 5, 2023
test_runner: fix missing test diagnostics
PR-URL: #46450 Backport-PR-URL: #46839 Fixes: #45911 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent c5f16fb commit ba784e8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
 

‎lib/internal/test_runner/runner.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,12 @@ class FileTest extends Test {
139139
return secondSpaceIndex === -1 &&
140140
ArrayPrototypeIncludes(kDiagnosticsFilterArgs, StringPrototypeSlice(comment, 0, firstSpaceIndex));
141141
}
142-
#handleReportItem({ kind, node, nesting = 0 }) {
142+
#handleReportItem({ kind, node, comments, nesting = 0 }) {
143143
nesting += 1;
144144

145+
if (comments) {
146+
ArrayPrototypeForEach(comments, (comment) => this.reporter.diagnostic(nesting, this.name, comment));
147+
}
145148
switch (kind) {
146149
case TokenKind.TAP_VERSION:
147150
// TODO(manekinekko): handle TAP version coming from the parser.

‎test/message/test_runner_output_cli.out

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ TAP version 13
5757
---
5858
duration_ms: *
5959
...
60+
# this test should pass
6061
# Subtest: sync throw fail
6162
not ok 8 - sync throw fail
6263
---
@@ -204,6 +205,7 @@ TAP version 13
204205
*
205206
*
206207
...
208+
# this subtest should make its parent test fail
207209
1..1
208210
not ok 21 - subtest sync throw fail
209211
---
@@ -365,6 +367,7 @@ TAP version 13
365367
---
366368
duration_ms: *
367369
...
370+
# \#diagnostic
368371
# Subtest: callback pass
369372
ok 41 - callback pass
370373
---

0 commit comments

Comments
 (0)
Please sign in to comment.