https://kotlinlang.org logo
#coroutines
Title
# coroutines
m

magnumrocha

08/23/2021, 2:50 PM
hey guys, is it possible to test Flows on Kotlin Multiplatform (
commonTest
,
androidTest
,
iosTest
) ? how to deal with Coroutine Context?
a

Alexandre Brown

08/23/2021, 3:10 PM
Hello, have you tried to use
TestCoroutineDispatcher*()
from* kotlinx-coroutines-test/kotlinx.coroutines.test/TestCoroutineDispatcher
m

mkrussel

08/23/2021, 3:11 PM
That's not usable from common code since it is JVM only.
🎯 2
a

Alexandre Brown

08/23/2021, 3:12 PM
Oh I see, thanks for letting me know, I only tried it on the JVM, good catch
👍 1
m

mkrussel

08/23/2021, 3:13 PM
I would look into using turbine. https://github.com/cashapp/turbine
👍 2
🎯 1
🔍 1
m

magnumrocha

08/23/2021, 5:16 PM
thank you @mkrussel this has worked as expected 🙏
👍 1
4 Views