Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix
  • Loading branch information
MoLow committed Jun 15, 2022
commit ea7383237ea2831903868bb7ced8eab7ccfe1c9c
7 changes: 4 additions & 3 deletions lib/internal/test_runner/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class Test extends AsyncResource {
this.reporter = new TapStream();
this.runOnlySubtests = this.only;
this.testNumber = 0;
this.shouldReportSubtest = false;
} else {
const indent = parent.parent === null ? parent.indent :
parent.indent + parent.indentString;
Expand All @@ -104,6 +105,7 @@ class Test extends AsyncResource {
this.reporter = parent.reporter;
this.runOnlySubtests = !this.only;
this.testNumber = parent.subtests.length + 1;
this.shouldReportSubtest = true;
}

if (isUint32(concurrency) && concurrency !== 0) {
Expand Down Expand Up @@ -162,7 +164,6 @@ class Test extends AsyncResource {
processReadySubtestRange(canSend) {
const start = this.waitingOn;
const end = start + this.readySubtests.size;
let shouldReportSubtest = this.parent !== null;

for (let i = start; i < end; i++) {
const subtest = this.readySubtests.get(i);
Expand All @@ -184,9 +185,9 @@ class Test extends AsyncResource {
return;
}

if (shouldReportSubtest) {
if (this.shouldReportSubtest) {
Comment thread
MoLow marked this conversation as resolved.
Outdated
this.reporter.subTest(this.indent, this.name);
shouldReportSubtest = false;
this.shouldReportSubtest = false;
}

// Report the subtest's results and remove it from the ready map.
Expand Down
1 change: 0 additions & 1 deletion test/message/test_runner_output.out
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ not ok 22 - sync throw non-error fail
---
duration_ms: *
...
# Subtest: level 0a
# Subtest: level 1c
ok 3 - level 1c
---
Expand Down