https://kotlinlang.org logo
Title
a

aiidziis

04/12/2021, 2:53 PM
By looking at
mvikotlin:sample
application I had an assumption that tests are working on iOS as well. When cloning repository I found that tests are enabled only for android and js targets. What would it take to get the same tests running for iOS target as well?
a

Arkadii Ivanov

04/12/2021, 2:54 PM
Hi, tests should work for all targets including iOS. Why do you think iOS tests are not working?
a

aiidziis

04/12/2021, 2:55 PM
They can’t be executed from IDE.
a

Arkadii Ivanov

04/12/2021, 2:56 PM
Perhaps it is an IDE bug, there should be corresponding Gradle tasks, could you try running it?
a

aiidziis

04/12/2021, 2:57 PM
can’t see iosTest task
a

Arkadii Ivanov

04/12/2021, 3:07 PM
Are you on MacOS?
a

aiidziis

04/12/2021, 3:07 PM
yes
a

Arkadii Ivanov

04/12/2021, 3:09 PM
Alright, I forgot that
todo-coroutines
module has only Android and JS targets enabled.
Because iOS app only uses reaktive version of the shared sample code
a

aiidziis

04/12/2021, 3:12 PM
then probably this test implementation won’t work on iOS with coroutines
a

Arkadii Ivanov

04/12/2021, 3:14 PM
What test implementation?
kind of this way, by just dispatching intern on store and after that already asserting the result on store state
a

Arkadii Ivanov

04/12/2021, 3:17 PM
Since the iOS target is not enabled for
todo-coroutines
module, it can no be even compiled against iOS currently. You can try enabling the iOS target here, but you will need to use
native-mt
version of the coroutines.
Because the sample uses SQLDelight and it should be accessed on background thread.
a

aiidziis

04/12/2021, 3:28 PM
enabled them and they actually ran fine, thanks
👍 1
a

Arkadii Ivanov

04/12/2021, 3:29 PM
Thanks for the feedback, I will consider enabling it.