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

Fix crash on shouldCallGetNode in tests #511

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GertjanReynaert
Copy link

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.

In our test suite `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.
@rodperottoni
Copy link

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 ?

@rvera
Copy link

rvera commented Dec 10, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants