Skip to content

🚀 Feature Request: Await waitUntils in unstable_dev #2474

@WalshyDev

Description

@WalshyDev

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 my expects.

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 on UnstableDevWorker like waitForWaitUntils.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestunstable_devRelating to existing unstable_dev

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions