Repository navigation
test: build the cache provider context with a type assertion - #20
Merged
Merged
Conversation
Astro 7.3.3 adds a required logger to the context onRequest receives, so the test helper object fails tsc on the Renovate upgrade. The provider never reads it; asserting the context type keeps the helper valid on 7.2 and 7.3.
🟢 Tier S · Ready to merge
The cache-provider test helper now creates the request context separately and casts it to the parameter type of
📂 Walkthrough · 1
Reviewed |
This was referenced Nov 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Renovate's Astro 7.3.3 security update (#18) fails
Type check:test/cache-provider.test.js(31,28): Property 'logger' is missing. Main is green on Astro 7.2; the failure comes from the upgrade itself.Why
Astro 7.3.3 makes
loggera required member of the context passed to a cache provider'sonRequest. The test helper builds that context as an object literal without it. The provider never readslogger, so only the type changed.Fix
Assert the helper's context to
Parameters<typeof instance.onRequest>[0]. That keeps the test valid against both Astro 7.2 (current lock) and 7.3.3, so this can merge first and #18 passes after a rebase.Verified locally:
npm run typecheckandnpm test(67 pass) on the current lock and withastro@7.3.3installed;biome formatandbiome lintare clean. Without the change,astro@7.3.3reproduces the TS2345 error.Opened from a fork because I don't have push access to this repository.