what’s the recommended way of handling unit tests for classes that may have different way of constructing them on Android/iOS? Example SQLDelight requires an Android Context to be passed to the AndroidSqliteDriver while it’s not used for the NativeSqliteDriver. Is it better to create separate tests for Android module and iOS module, or use the common test module and check at runtime somehow if we’re testing on Android (pass the context then) vs iOS?
03/23/2021, 4:02 PM
You can use expect/actual for that
03/23/2021, 4:31 PM
yes for the implementation, but what about for testing? would you test android/iOS using the actual declarations separately?
03/23/2021, 4:32 PM
no. common tests and expect/actual to create the driver
Keep in mind that those tests were written to be able to test with the JS driver as well which had to be initialized in a coroutine. If you don't plan on needing to target Kotlin/JS you can simplify some of it.