Fix React Native 0.80.2 and Jest 30 compatibility issues #308
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.
Summary
This PR fixes compatibility issues after running
npm audit fix --forcewhich updated React Native to 0.80.2 and Jest to 30.0.5.Changes
Jest Configuration
babel.config.jswith@react-native/babel-presetto handle Flow type annotationsmockResolvedValuetoBeCalledWithtotoHaveBeenCalledWithDependencies Updated
metro-react-native-babel-presetuuidfrom 3.3.2 to 11.1.0reactandreact-test-rendererto 19.1.1@babel/runtimeto 7.28.2Test Fixes
Test Results
✅ All 104 tests passing
✅ 0 vulnerabilities
✅ Compatible with React Native 0.80.2 and Jest 30.0.5
Testing
npm testnpm auditGithub Copilot Summary
This pull request updates the test assertions in
__tests__/index.test.jsto use Jest's.toHaveBeenCalledWithmatcher instead of.toBeCalledWithwhen verifying calls to native module methods. This change aligns the tests with current Jest best practices and ensures more accurate and idiomatic test assertions.Test assertion improvements:
.toBeCalledWithwith.toHaveBeenCalledWithin assertions forNativeModules.MixpanelReactNativemethod calls, improving test reliability and consistency with Jest standards. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32]