Skip to content
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

feat: sequencer saving may be async #10980

Merged
merged 1 commit into from Dec 26, 2020

Conversation

FauxFaux
Copy link
Contributor

Summary

Allow a TestSequencer implementation to perform async operations during its allFailedTests and cacheResults phases.

It's already allowed for sort, but not for the other methods, which I believe are part of the public/extensible API.

My Sequencer wants to go to a database.

Test plan

There's already a test for sort, and I've added a similar test for allFailedTests.

It's hard to directly test cacheResults is awaited, as it's void. We could attempt to catch it with sleeps and testing the implementation ordering; e.g. checking if it has completed before the globalHook has run? It doesn't seem to have any value.
awaiting it is necessary, as otherwise longer cacheResults implementations eventually trigger the Jest did not exit one second after the test run has completed. failure.

@FauxFaux FauxFaux marked this pull request as ready for review December 26, 2020 10:19
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thanks!

@SimenB SimenB merged commit e84f682 into jestjs:master Dec 26, 2020
@github-actions
Copy link

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants