mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
test_runner: empty pending tests queue post running
PR-URL: https://github.com/nodejs/node/pull/44059 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
@@ -523,6 +523,7 @@ class Test extends AsyncResource {
|
||||
|
||||
// The test has run, so recursively cancel any outstanding subtests and
|
||||
// mark this test as failed if any subtests failed.
|
||||
this.pendingSubtests = [];
|
||||
for (let i = 0; i < this.subtests.length; i++) {
|
||||
const subtest = this.subtests[i];
|
||||
|
||||
|
||||
@@ -5,4 +5,4 @@ const test = require('node:test');
|
||||
|
||||
test('pass');
|
||||
test('never resolving promise', () => new Promise(() => {}));
|
||||
test('fail');
|
||||
test('fail', () => console.log('this should not appear'));
|
||||
|
||||
@@ -17,7 +17,7 @@ not ok 2 - never resolving promise
|
||||
# Subtest: fail
|
||||
not ok 3 - fail
|
||||
---
|
||||
duration_ms: *
|
||||
duration_ms: 0
|
||||
failureType: 'cancelledByParent'
|
||||
error: 'test did not finish before its parent and was cancelled'
|
||||
code: 'ERR_TEST_FAILURE'
|
||||
|
||||
Reference in New Issue
Block a user