react-native-keyboard-aware-scroll-view icon indicating copy to clipboard operation
react-native-keyboard-aware-scroll-view copied to clipboard

Fix crash on `shouldCallGetNode` in tests

Open GertjanReynaert opened this issue 2 years ago • 2 comments

In our test suite (jest + react-native-testing-library) Platform.constants is an empty object. This was making the previous !Platform.constants check pass, but caused a crash when trying to access major on reactNativeVersion.

This fix correctly checks if reactNativeVersion is present and is an object to avoid this issue.

GertjanReynaert avatar Sep 28 '21 14:09 GertjanReynaert

This is a legitimate issue breaking all test suites on the latest versions of React Native. Could any contributor in this project please approve this PR ?

rodperottoni avatar Nov 20 '21 04:11 rodperottoni

Can second this is a huge issue for me too and this fixes it for me.

rvera avatar Dec 10 '21 22:12 rvera