-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Support async sort in custom testSequencer. #8642
Conversation
@@ -183,7 +183,7 @@ export default (async function runJest({ | |||
}), | |||
); | |||
|
|||
allTests = sequencer.sort(allTests); | |||
allTests = await sequencer.sort(allTests); |
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.
This is the entire PR, the rest is test and docs.
Codecov Report
@@ Coverage Diff @@
## master #8642 +/- ##
======================================
Coverage 63.4% 63.4%
======================================
Files 274 274
Lines 11342 11342
Branches 2770 2771 +1
======================================
Hits 7191 7191
Misses 3534 3534
Partials 617 617
Continue to review full report at Codecov.
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
When overriding
testSequencer
with custom logic, forcing synchronous sorting can be limiting. One use-case is fetching test runtime from an endpoint instead of relying on the local cache; this requires an async roundtrip and is not currently possible.This extremely simple PR adds the optional ability for
sort
to return aPromise
without requiring it to.Test plan
sort
.