Skip to content

Commit b5b3f0b

Browse files
committed
fix: fix missing test diagnostics
PR-URL: nodejs/node#46450 Fixes: nodejs/node#45911 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> (cherry picked from commit 1118db718c8429f5f343aca90ccb570244e282b4)
1 parent d6f071a commit b5b3f0b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/internal/test_runner/runner.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// https://github.com/nodejs/node/blob/61c65b066b098cf47f89206212864ec1cddb8782/lib/internal/test_runner/runner.js
1+
// https://github.com/nodejs/node/blob/1118db718c8429f5f343aca90ccb570244e282b4/lib/internal/test_runner/runner.js
22
'use strict'
33
const {
44
ArrayFrom,
@@ -134,9 +134,12 @@ class FileTest extends Test {
134134
ArrayPrototypeIncludes(kDiagnosticsFilterArgs, StringPrototypeSlice(comment, 0, firstSpaceIndex))
135135
}
136136

137-
#handleReportItem ({ kind, node, nesting = 0 }) {
137+
#handleReportItem ({ kind, node, comments, nesting = 0 }) {
138138
nesting += 1
139139

140+
if (comments) {
141+
ArrayPrototypeForEach(comments, (comment) => this.reporter.diagnostic(nesting, this.name, comment))
142+
}
140143
switch (kind) {
141144
case TokenKind.TAP_VERSION:
142145
// 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)