Brais Gabin
03/18/2022, 9:49 AMUnconfinedTestDispatcher
. Can I use UnconfinedTestDispatcher
as a StandardTestDispatcher
but that it does the advanceUntilIdle
automatically for me? Am I missing something here? I know that I'll lose some flexibility but in a lot of my tests I don't need that flexibility.Sam
03/18/2022, 9:51 AMUnconfinedTestDispatcher
doesn't really advance all coroutines until idleSam
03/18/2022, 9:51 AMSam
03/18/2022, 9:55 AMBrais Gabin
03/18/2022, 9:59 AMBrais Gabin
03/18/2022, 10:02 AMUncofinedTestDispatcher
automatically does the runCurrent
?Sam
03/18/2022, 10:08 AMSam
03/18/2022, 10:09 AMwe ensure that the launch and async blocks at the top level of runTest are entered eagerly. This allows launching child coroutines and not calling runCurrent for them to start executing.
Sam
03/18/2022, 10:12 AMBrais Gabin
03/18/2022, 10:21 AMUncofinedTestDispatcher
is more less as an automatic runCurrent
.Tim Oltjenbruns
03/18/2022, 12:28 PMrunBlocking
and no fancy dispatcher.Tim Oltjenbruns
03/18/2022, 12:29 PMBrais Gabin
03/19/2022, 12:29 PMrunBlocking
nor run(Blocking)test
. I just need to inject a CoroutineScope
to my subject under test. And I'm injecting TestScope(UnconfinedTestDispatcher)
. should I inject something different? I like the idea of use kotlinx.coroutine.test
as less as possible:
1. It is at experimental
2. Reduce the number of no-production code that is executed in my tests.Tim Oltjenbruns
03/19/2022, 12:32 PMTim Oltjenbruns
03/19/2022, 12:32 PMdead.fish
09/09/2022, 12:10 PM