benkuly
11/07/2023, 5:16 PMdispatcher
is deprecated in `MockEngine`: Is there an alternative for the following test use case:
val testScope = CoroutineScope(coroutineContext + SupervisorJob()) // coroutineContext is from TestDispatcher
testScope.launch {
println(1)
delay(10000)
println(2)
HttpClient(mockEngine).post("/bla")
println(3)
}
testCoroutineScheduler.advanceUntilIdle()
println("---------------")
This will print:
1
2
---------------
But I expect advanceUntilIdle
to wait for the http request too.e5l
11/08/2023, 8:01 AM