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
FetchEvent#waitUntil in Jest context #202
Comments
The implementation of miniflare/packages/core/src/standards/event.ts Lines 80 to 85 in dc55621
|
Hey! 👋 Thanks for raising this. Will try get a |
@mrbbot any news on this? Can I help? |
Hey! 👋 Apologies for the delayed response. I've recently returned from a long holiday and am catching up on issues now. @jamesarosen I'd be very happy to accept a pull-request for this, otherwise I can do it. You'll need to add a miniflare/packages/jest-environment-miniflare/src/index.ts Lines 222 to 235 in 5a48285
...that accesses the
|
Just want to add a note that when using function testResponse(body) {
return new Response(body, { headers: { "Cache-Control": "max-age=3600" } });
}
...
event.waitUntil(caches.default.put(url, testResponse("example cache"))); |
@CraigglesO I poked at this a bit. I'm glad you did it because your #345 looks much better than what I had! |
Problem
The promises passed to
FetchEvent.prototype.waitUntil
cannot be retrieved viaResponse.prototype.waitUntil()
. There doesn't seem to be any other way to access them either, but if there is, the Writing and Running Tests docs don't mention it.Configuration
Example Code
The text was updated successfully, but these errors were encountered: