Skip to content

chore: Create plugin iOS native code generation snapshot tests #169

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

Merged

Conversation

mahmoud-elmorabea
Copy link
Contributor

@mahmoud-elmorabea mahmoud-elmorabea commented Nov 29, 2024

This PR adds unit tests for the native code generated by our Expo plugin.

This PR focuses on the iOS generated code.

Options considered

Option 1: Use Jest's snapshot testing (Recommended)
  • This option uses Jest's snapshot testing to capture a snapshot of the result of the generated code by our Expo plugin
  • Then for all subsequent runs we use the captured snapshot to make sure that the generated code is still as expected
Option 2: Custom testing
  • This option would depend on us writing tests that find certain code parts or lines that are generated
  • This option is a bit problematic since we have to handle different versions of Expo by ourselves
  • This option is also challenging since we'll probably have to write code that is equality complicated to the code that generate the code under test

@mahmoud-elmorabea mahmoud-elmorabea self-assigned this Nov 29, 2024
@mahmoud-elmorabea mahmoud-elmorabea force-pushed the MBL-720-ios-snapshot-tests branch from e2586d4 to 2bddb2e Compare November 29, 2024 17:57
@mahmoud-elmorabea mahmoud-elmorabea changed the base branch from MBL-720-updated-ios-code-generation to MBL-719-run-plugin-tests-cio November 29, 2024 17:58
@mahmoud-elmorabea mahmoud-elmorabea changed the base branch from MBL-719-run-plugin-tests-cio to MBL-720-updated-ios-code-generation November 29, 2024 17:58
@mahmoud-elmorabea mahmoud-elmorabea force-pushed the MBL-720-updated-ios-code-generation branch from 008d8a7 to fdd7157 Compare December 4, 2024 18:43
Base automatically changed from MBL-720-updated-ios-code-generation to feature/cio-rn-v4-support December 5, 2024 13:23
@mahmoud-elmorabea mahmoud-elmorabea force-pushed the MBL-720-ios-snapshot-tests branch from 2bddb2e to e2f5d2f Compare December 5, 2024 14:26
@mahmoud-elmorabea mahmoud-elmorabea marked this pull request as ready for review December 5, 2024 14:38
@mahmoud-elmorabea mahmoud-elmorabea requested a review from a team December 5, 2024 14:38
Copy link
Contributor

@Shahroz16 Shahroz16 left a comment

Choose a reason for hiding this comment

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

Same as other PR, we will be discussing the changes sync. Adding comment because didn't want to leave PRs unattended.

- Rename AppDelegate test files to be consistent with others
- Remove Expo version from some test names
@mahmoud-elmorabea mahmoud-elmorabea requested a review from a team December 11, 2024 10:44
@mahmoud-elmorabea mahmoud-elmorabea merged commit 5dd50f9 into feature/cio-rn-v4-support Dec 12, 2024
5 checks passed
@mahmoud-elmorabea mahmoud-elmorabea deleted the MBL-720-ios-snapshot-tests branch December 12, 2024 11:57
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.

2 participants