A Reflex design test: keeping iOS and Android apps in sync with a single test even when built separately(zenn.dev)
Writing language: KoreanRead in the original language
Plain summary
- Reflex is a design Shopify created while moving a React Native app to native Swift and Kotlin. It separates the screens from the app's calculation logic, so the logic can be run without a simulator. It was published as an explanatory article, not as a library.
- No code is shared. A single behavior test written in TypeScript is run identically on both platforms. A PR that passes on only one side cannot be merged. Shopify said that more than 1,700 tests take about 4 minutes on both CIs.
- If even one external request goes out during a test, it is treated as a failure, even if the app swallows the error. The author (a Teranovel developer) built a weather app and ran 21 tests, and wrote that it took 48ms on iOS and 270ms on Android (including JVM startup).
- The shared test also revealed differences between the two platforms. When a number was sent as a string, Swift raised an error while Kotlin accepted it, so only Android failed, and the author fixed the Kotlin side.
Editorial opinion
O: A mobile lead who has started moving a React Native app to native suggests running the TypeScript tests for one small feature, such as login, on both iOS and Android.
X: The author's 21 tests are based on a weather app they built themselves, while Shopify's 1,700 and about 4 minutes are figures announced by the company, so the time for our app's scale has to be measured separately.
Writing language: Korean
Found on
Zenn ↗ / Published by source
Have you run into something like this? Tell us in a line or two what you did. You do not need to know the product.