-
-
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
await for async jest config #8357
Conversation
You can run tests with Can you give me an example of how this is used and also update documentation with that as well? |
@scotthovestadt thanks
I added an example of such use is in the docs section, here a more advanced section: import * as request from 'request-promise';
export async ()=>{
return await request('http://some-remote')
} Basically for my use cases, I found a way to do it synchronically, I think it would be much nicer to do it async. |
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.
Please add a test (integration test perhaps?) with async config. Also please update the changelog and fix the linting error reported by CI 🙂
This is technically a breaking change if anybody else uses jest-config
to load jest's config instead of letting Jest itself do it. Is that ok?
+1 for breaking, put it in a major 😅 |
@SimenB I didn't notice any integration test for current implementation, do you have an idea how to mock this scenario? Thanks in advance! |
This is a really small breaking change, so we can land it in 25. @hisco could you rebase on master? |
@SimenB I did, unfortunately it's completely broken: |
@hisco sorry, I missed your answer, then completely forgot about this 😬 I made |
@hisco ping 🙂 |
It seems that most of my changes are already in master I don't think it's a result of a merge with my code so I won't take the credit... |
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
Currently jest cli
require
the dynamic config module synchronously, this PR enables loading jest config module async.Test plan
Tested project using
yarn test
- got some issues not related to my change:In addition created a tiny project and tested the async config module using
yarn link
- no issues were observed.