test(metro): Add type tests for SentryExpoConfigOptions.getDefaultConfig#5733
Merged
test(metro): Add type tests for SentryExpoConfigOptions.getDefaultConfig#5733
Conversation
Adds type compatibility tests validating the fix from #5246: - New format: a function with the flexible `Record<string, unknown>` signature (Expo SDK 54 style, accommodating diverged Metro types) - Old format: the classic wrapping pattern where users call `expo/metro-config`'s getDefaultConfig and return a modified config Follows up on the type-test suggestion in #5246 (comment) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog.
🤖 This preview updates automatically when you update the PR. |
lucas-zimerman
approved these changes
Feb 27, 2026
Collaborator
lucas-zimerman
left a comment
There was a problem hiding this comment.
Thank you for adding the tests!
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.
📢 Type of change
📜 Description
Follow-up to #5246. Adds type compatibility tests for
SentryExpoConfigOptions.getDefaultConfigas suggested in the review comment.Two tests validate the fix:
New format (Expo SDK 54): A function with the flexible
Record<string, unknown>signature compiles — this was the core fix, accommodating Metro type definitions that diverged between@expo/metroand the standalonemetropackage.Old usage pattern: The classic wrapping pattern (calling
expo/metro-config'sgetDefaultConfigand returning a spread/modified config object) still works —Record<string, unknown>options are compatible withDefaultConfigOptions(all optional fields), and the spread object return type is compatible withRecord<string, unknown>.💡 Motivation and Context
Follows up on the suggestion from @lucas-zimerman in #5246 (comment):
💚 How did you test it?
yarn test:tools— all 117 tests passnpx tsc --noEmit— no new TypeScript errors📝 Checklist
sendDefaultPIIis enabled