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

[segment] unify native initialization methods #8046

Merged
merged 5 commits into from May 21, 2020
Merged

Conversation

cruzach
Copy link
Contributor

@cruzach cruzach commented Apr 27, 2020

Why

Most of our other APIs have the same method names across Android/iOS so we can reduce our JS code. This PR also handles the case where either an empty object is provided, or write keys are unknowingly null when passed in (happened to a partner of ours) resulting in the Expo Client (or standalones) crashing

How

Rename methods & re-mock NativeModules

Test Plan

added/rewrote tests

@github-actions
Copy link
Contributor

Native Component List for this branch is ready



Copy link
Contributor

@sjchmiela sjchmiela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thank you very much! 🎉

packages/jest-expo/src/preset/expoModules.js Outdated Show resolved Hide resolved
AROrientationTrackingConfiguration: { type: 'boolean', mock: false },
ARWorldTrackingConfiguration: { type: 'boolean', mock: false },
AROrientationTrackingConfiguration: { type: 'boolean', mock: true },
ARWorldTrackingConfiguration: { type: 'boolean', mock: true },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I try to not modify those mocks files when I commit this file, otherwise every other person regenerating it in a different environment would always change this, status bar height, deviceYearClass etc. But that's just a suggestion!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah that's a good call, thanks!

@github-actions
Copy link
Contributor

Native Component List for this branch is ready

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.

None yet

2 participants