-
-
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
Allow setupFiles and setupTestFrameworkScriptFile to be asynchronous #2147
Comments
Is there anything that prevents you to await this code in |
Mostly cleanliness and DRY code. Nothing prevents me from doing a |
We'll not be adding this for now as the complexity isn't really worth it. The recommended solution is to create a test utils file and use it like so:
|
OK, I understand your position. Thanks for having a look at it. 👍 |
Note that it's possible to put a |
Oh wow, @tamlyn, it really worked for me! My god, for years I didn't know about this solution! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature request
What is the current behavior?
Currently,
setupFiles
andsetupTestFrameworkScriptFile
can only setup environment synchronously.What is the expected behavior?
It would be great if it Jest would run the test after awaiting any Promise that is the default export of any
setupFile
orsetupTestFrameworkScriptFile
the before running each test.The text was updated successfully, but these errors were encountered: