Jest is a "delightful JavaScript Testing Framework with a focus on simplicity".
The order in which it runs tests is not arbitrary because "it has a great impact on the user-perceived responsiveness and speed of the test run." First it runs tests that failed in the previous run, then tests that are slow or expected to be slow.
The code itself is quite simple and not that interesting, but what's instructive is this observation that you can improve user experience by prioritizing tests.
General
Description
Jest is a "delightful JavaScript Testing Framework with a focus on simplicity".
The order in which it runs tests is not arbitrary because "it has a great impact on the user-perceived responsiveness and speed of the test run." First it runs tests that failed in the previous run, then tests that are slow or expected to be slow.
Links
Implementation
Test
What makes it interesting
The code itself is quite simple and not that interesting, but what's instructive is this observation that you can improve user experience by prioritizing tests.
Related work
Sorting tests in JUnit: https://github.com/junit-team/junit4/blob/9ad61c6bf757be8d8968fd5977ab3ae15b0c5aba/src/main/java/org/junit/runner/manipulation/Sorter.java, https://github.com/junit-team/junit4/blob/9ad61c6bf757be8d8968fd5977ab3ae15b0c5aba/src/main/java/org/junit/runner/manipulation/Ordering.java. As far as I can see, it runs them alphabetically.
Other
N/A