Skip to content

Commit 45f580f

Browse files
MoLowdanielleadams
authored andcommitted
test_runner: empty pending tests queue post running
PR-URL: #44059 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
1 parent a6c6e88 commit 45f580f

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

lib/internal/test_runner/test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ class Test extends AsyncResource {
523523

524524
// The test has run, so recursively cancel any outstanding subtests and
525525
// mark this test as failed if any subtests failed.
526+
this.pendingSubtests = [];
526527
for (let i = 0; i < this.subtests.length; i++) {
527528
const subtest = this.subtests[i];
528529

test/message/test_runner_unresolved_promise.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ const test = require('node:test');
55

66
test('pass');
77
test('never resolving promise', () => new Promise(() => {}));
8-
test('fail');
8+
test('fail', () => console.log('this should not appear'));

test/message/test_runner_unresolved_promise.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ not ok 2 - never resolving promise
1717
# Subtest: fail
1818
not ok 3 - fail
1919
---
20-
duration_ms: *
20+
duration_ms: 0
2121
failureType: 'cancelledByParent'
2222
error: 'test did not finish before its parent and was cancelled'
2323
code: 'ERR_TEST_FAILURE'

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy