Skip to content

Commit b24517e

Browse files
committed
node:test add Subtest to tap protocol output
just used tap-mocha-reporter to compare how output will look visually and saw it was missing
1 parent 486dcd7 commit b24517e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/internal/test_runner/tap_stream.js

+4
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ class TapStream extends Readable {
7171
return `TODO${reason ? ` ${tapEscape(reason)}` : ''}`;
7272
}
7373

74+
subTest(indent, name) {
75+
this.#tryPush(`${indent}# Subtest: ${tapEscape(name)}\n`);
76+
}
77+
7478
details(indent, duration, error) {
7579
let details = `${indent} ---\n`;
7680

lib/internal/test_runner/test.js

+1
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ class Test extends AsyncResource {
280280
}
281281

282282
start() {
283+
this.reporter.subTest(this.indent, this.name);
283284
// If there is enough available concurrency to run the test now, then do
284285
// it. Otherwise, return a Promise to the caller and mark the test as
285286
// pending for later execution.

0 commit comments

Comments
 (0)