-
Notifications
You must be signed in to change notification settings - Fork 717
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
🚀 Feature Request: Await waitUntils in unstable_dev #2474
Comments
First thoughts: Sounds like a good idea and something useful to add - and no, there's no way to do this with But it sounds like it'd be an additive change - I wouldn't block promoting |
I actually started working with the testing-library maintainer on an agnostic |
This should be possible with the Vitest integration, using the |
Describe the solution
I'm using unstable_dev extensively in testing right now but just hit a roadblock. I have a fetch being done in a
waitUntil
which I need to happen before all myexpects
.There is no way to wait for this today in
unstable_dev
from what I can tell. It would be great to have a function onUnstableDevWorker
likewaitForWaitUntils
.Miniflare does have something for this already: https://miniflare.dev/testing/vitest#waiting-for-waituntiled-promises
However, this requires me to use the Miniflare test env. I want to avoid this and rely on solely Wrangler here. A lot of users may not even know that Miniflare will run these tests so there needs to be some option in Wrangler (not to forget you can also use
workerd
though still through Miniflare)Regardless, this would be great to have before
dev
goes stable :)cc: @rozenmd
The text was updated successfully, but these errors were encountered: