Skip to content

Commit 391a2e1

Browse files
committed
test_runner: fix missing test diagnostics
1 parent 7d014d9 commit 391a2e1

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

‎lib/internal/test_runner/runner.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,11 @@ function getRunArgs({path, inspectPort }){
130130

131131
classFileTestextendsTest{
132132
#buffer =[];
133-
#handleReportItem({ kind, node, nesting =0}){
133+
#handleReportItem({ kind, node,comments,nesting =0}){
134134
nesting+=1;
135-
135+
if(comments){
136+
ArrayPrototypeForEach(comments,(comment)=>this.reporter.diagnostic(nesting,this.name,comment));
137+
}
136138
switch(kind){
137139
caseTokenKind.TAP_VERSION:
138140
// TODO(manekinekko): handle TAP version coming from the parser.

‎test/message/test_runner_output_cli.out‎

Lines changed: 3 additions & 0 deletions
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)