Skip to content

Commit

Permalink
test_runner: fix missing test diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLow committed Jan 31, 2023
1 parent 7d014d9 commit 391a2e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/internal/test_runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@ function getRunArgs({ path, inspectPort }) {

class FileTest extends Test {
#buffer = [];
#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 391a2e1

Please sign in to comment.