Skip to content

Commit ea73832

Browse files
committed
fix
1 parent 99db836 commit ea73832

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/internal/test_runner/test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ class Test extends AsyncResource {
9393
this.reporter = new TapStream();
9494
this.runOnlySubtests = this.only;
9595
this.testNumber = 0;
96+
this.shouldReportSubtest = false;
9697
} else {
9798
const indent = parent.parent === null ? parent.indent :
9899
parent.indent + parent.indentString;
@@ -104,6 +105,7 @@ class Test extends AsyncResource {
104105
this.reporter = parent.reporter;
105106
this.runOnlySubtests = !this.only;
106107
this.testNumber = parent.subtests.length + 1;
108+
this.shouldReportSubtest = true;
107109
}
108110

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

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

187-
if (shouldReportSubtest) {
188+
if (this.shouldReportSubtest) {
188189
this.reporter.subTest(this.indent, this.name);
189-
shouldReportSubtest = false;
190+
this.shouldReportSubtest = false;
190191
}
191192

192193
// Report the subtest's results and remove it from the ready map.

test/message/test_runner_output.out

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ not ok 22 - sync throw non-error fail
238238
---
239239
duration_ms: *
240240
...
241-
# Subtest: level 0a
242241
# Subtest: level 1c
243242
ok 3 - level 1c
244243
---

0 commit comments

Comments
 (0)