nestserau
12/21/2018, 10:21 AMrunBlocking
is not available for iOS, but what’s the proper way to unit test suspend functions on iOS Simulator then?Jurriaan Mous
12/21/2018, 10:52 AMexpect fun runSuspendingTest(block: suspend () -> Unit)
import kotlinx.coroutines.runBlocking
actual fun runSuspendingTest(block: suspend () -> Unit) = runBlocking { block() }
Usage:
@Test
fun test() = runSuspendingTest {
// Suspending tests here
}
nestserau
12/21/2018, 11:10 AMYou can’t use runBlocking with ios client engine for now: the request is scheduled in the main queue.
nestserau
12/21/2018, 11:11 AMJurriaan Mous
12/21/2018, 11:52 AMbootstraponline
12/21/2018, 3:56 PMnestserau
12/21/2018, 4:04 PM