Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLow committed Jun 14, 2022
1 parent 6ae4e74 commit 5005c5c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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) {
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

0 comments on commit 5005c5c

Please sign in to comment.