Skip to content
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

Cache API tests #447

Merged
merged 8 commits into from
Nov 30, 2022
Merged

Cache API tests #447

merged 8 commits into from
Nov 30, 2022

Conversation

mrbbot
Copy link
Contributor

@mrbbot mrbbot commented Nov 25, 2022

This PR adds testing for Miniflare 3's Cache API. I've written these as integration tests. Along the way, I fixed some bugs with caching streamed responses, and using cf.cacheKey.

This PR is pretty big, because it also adds lots of the required integration testing infrastructure. Hopefully, it should be easier to add tests for other features after this.

@mrbbot mrbbot added the tre Relating to Miniflare 3 label Nov 25, 2022
@mrbbot mrbbot added this to the 3.0.0 milestone Nov 25, 2022
@changeset-bot
Copy link

changeset-bot bot commented Nov 25, 2022

⚠️ No Changeset found

Latest commit: 15ffc9b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -246,7 +253,8 @@ export class CacheGateway {
throw new StorageFailure();
}

await this.storage.put<CacheMetadata>(request.url, {
cacheKey ??= request.url;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clever

@mrbbot mrbbot merged commit 3c1f95c into tre Nov 30, 2022
@mrbbot mrbbot deleted the tre-cache-tests branch November 30, 2022 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tre Relating to Miniflare 3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants