Skip to content

Commit

Permalink
test_runner: add Subtest to tap protocol output
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLow committed Jun 14, 2022
1 parent 486dcd7 commit 6ba42fc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/internal/test_runner/tap_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ class TapStream extends Readable {
return `TODO${reason ? ` ${tapEscape(reason)}` : ''}`;
}

subTest(indent, name) {
this.#tryPush(`${indent}# Subtest: ${tapEscape(name)}\n`);
}

details(indent, duration, error) {
let details = `${indent} ---\n`;

Expand Down
1 change: 1 addition & 0 deletions lib/internal/test_runner/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ class Test extends AsyncResource {
}

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

0 comments on commit 6ba42fc

Please sign in to comment.