-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_runner: refactor primordial-based Promise chains #55958
base: main
Are you sure you want to change the base?
Conversation
This commit refactors the buildSuite Promise logic in the Suite constructor to use an async function instead of creating an awkward primordial-based Promise chain.
This commit refactors the chain of functions in run() to use an async function instead of creating an awkward primordial-based Promise chain.
Review requested:
|
if (typeof postRun === 'function') { | ||
postRun(); | ||
} | ||
|
||
if (typeof teardown === 'function') { | ||
teardown(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (typeof postRun === 'function') { | |
postRun(); | |
} | |
if (typeof teardown === 'function') { | |
teardown(); | |
} | |
postRun?.(); | |
teardown?.(); |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #55958 +/- ##
==========================================
- Coverage 87.99% 87.98% -0.01%
==========================================
Files 653 653
Lines 187852 187857 +5
Branches 35888 35885 -3
==========================================
Hits 165295 165295
- Misses 15729 15734 +5
Partials 6828 6828
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This PR refactors two Promise chains in the test runner to use async/await style syntax instead. IMO this makes these two pieces of code significantly more readable (largely because of primordials), and will make some planned changes easier to implement.
test_runner: refactor build Promise in Suite()
This commit refactors the buildSuite Promise logic in the Suite
constructor to use an async function instead of creating an
awkward primordial-based Promise chain.
test_runner: refactor Promise chain in run()
This commit refactors the chain of functions in run() to use an
async function instead of creating an awkward primordial-based
Promise chain.