There are 2 sides to your question. Can we unit te...
# coroutines
k
There are 2 sides to your question. Can we unit test
launch
? Yes, we can. You simply run it within a
runBlocking
and
await
it’s completion (or termination as the case may be) However the
UI
makes it difficult to unit test without bringing all the platform dependency with it. I would abstract this part out instead, to make it easy to swap with a non-platform dependent coroutineContext
d
thanks! i switched to
Unconfined
for tests. looks like it works now
👍 1