@@ -17,7 +17,6 @@ const {
|
17 | 17 | ArrayPrototypeSort, |
18 | 18 | ObjectAssign, |
19 | 19 | PromisePrototypeThen, |
20 | | - PromiseResolve, |
21 | 20 | PromiseWithResolvers, |
22 | 21 | SafeMap, |
23 | 22 | SafePromiseAll, |
@@ -798,9 +797,17 @@ function run(options = kEmptyObject) {
|
798 | 797 | } |
799 | 798 | } |
800 | 799 | |
801 | | -const setupPromise = PromiseResolve(setup?.(root.reporter)); |
802 | | -PromisePrototypeThen(PromisePrototypeThen(PromisePrototypeThen(setupPromise, runFiles), postRun), teardown); |
| 800 | +const runChain = async () => { |
| 801 | +if (typeof setup === 'function') { |
| 802 | +await setup(root.reporter); |
| 803 | +} |
| 804 | + |
| 805 | +await runFiles(); |
| 806 | +postRun?.(); |
| 807 | +teardown?.(); |
| 808 | +}; |
803 | 809 | |
| 810 | +runChain(); |
804 | 811 | return root.reporter; |
805 | 812 | } |
806 | 813 | |
|