Commit 0a81cfc 1 parent 5b6851f commit 0a81cfc Copy full SHA for 0a81cfc
File tree 3 files changed +17
-7
lines changed
3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ exports.PromiseResolve = val => Promise.resolve(val)
33
33
exports . PromiseRace = val => Promise . race ( val )
34
34
exports . SafeArrayIterator = class ArrayIterator { constructor ( array ) { this . array = array } [ Symbol . iterator ] ( ) { return this . array . values ( ) } }
35
35
exports . SafeMap = Map
36
+ exports . SafePromiseAll = ( array , mapFn ) => Promise . all ( array . map ( mapFn ) )
36
37
exports . SafeSet = Set
37
38
exports . SafeWeakMap = WeakMap
38
39
exports . StringPrototypeMatch = ( str , reg ) => str . match ( reg )
Original file line number Diff line number Diff line change 4
4
5
5
const {
6
6
ArrayPrototypePush,
7
- ArrayPrototypeReduce,
8
7
ArrayPrototypeShift,
9
8
ArrayPrototypeUnshift,
10
9
FunctionPrototype,
11
10
Number,
12
- PromiseResolve,
13
11
ReflectApply,
14
12
SafeMap,
15
- PromiseRace
13
+ PromiseRace,
14
+ SafePromiseAll
16
15
} = require ( '#internal/per_context/primordials' )
17
16
const { AsyncResource } = require ( 'async_hooks' )
18
17
const {
@@ -510,10 +509,7 @@ class Suite extends Test {
510
509
this . parent . activeSubtests ++
511
510
this . startTime = hrtime ( )
512
511
const subtests = this . skipped || this . error ? [ ] : this . subtests
513
- await testTimeout ( ArrayPrototypeReduce ( subtests , async ( prev , subtest ) => {
514
- await prev
515
- await subtest . run ( )
516
- } , PromiseResolve ( ) ) , this . timeout )
512
+ await SafePromiseAll ( subtests , ( subtests ) => subtests . start ( ) )
517
513
this . pass ( )
518
514
this . postRun ( )
519
515
}
Original file line number Diff line number Diff line change @@ -188,6 +188,10 @@ ok 20 - immediate resolve pass
188
188
*
189
189
*
190
190
*
191
+ *
192
+ *
193
+ *
194
+ *
191
195
...
192
196
1..1
193
197
not ok 21 - subtest sync throw fail
@@ -476,6 +480,9 @@ not ok 53 - custom inspect symbol that throws fail
476
480
*
477
481
*
478
482
*
483
+ *
484
+ *
485
+ *
479
486
...
480
487
# Subtest: sync throw fails at second
481
488
not ok 2 - sync throw fails at second
@@ -491,6 +498,10 @@ not ok 53 - custom inspect symbol that throws fail
491
498
*
492
499
*
493
500
*
501
+ *
502
+ *
503
+ *
504
+ *
494
505
...
495
506
1..2
496
507
not ok 54 - subtest sync throw fails
@@ -565,6 +576,8 @@ not ok 56 - describe async throw fails
565
576
failureType: 'testTimeoutFailure'
566
577
error: 'test timed out after 5ms'
567
578
code: 'ERR_TEST_FAILURE'
579
+ stack: |-
580
+ *
568
581
...
569
582
# Subtest: timed out callback test
570
583
not ok 2 - timed out callback test
You can’t perform that action at this time.
0 commit comments