GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_runner: refactor Promise chain in run() · nodejs/node@fb98fa4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/test_runner
    • runner.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/test_runner/runner.js‎

Copy file name to clipboardExpand all lines: lib/internal/test_runner/runner.js
+10-3Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ const {
1717
ArrayPrototypeSort,
1818
ObjectAssign,
1919
PromisePrototypeThen,
20-
PromiseResolve,
2120
PromiseWithResolvers,
2221
SafeMap,
2322
SafePromiseAll,
@@ -798,9 +797,17 @@ function run(options = kEmptyObject) {
798797
}
799798
}
800799

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+
};
803809

810+
runChain();
804811
return root.reporter;
805812
}
806813

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.