I think that there might be a better way to write test for such scenario because if I have 20 test than I have to write
runBlocking
20 times
j
Javier
10/10/2021, 2:09 PM
Until Coroutines 1.6 there is no alternative, only
runBlockingTest
, but you would have the same problem
Javier
10/10/2021, 2:10 PM
With 1.6 I think
suspend
test functions are allowed
j
Joffrey
10/10/2021, 7:35 PM
@Javier I believe the decision that was taken on this topic is that it is sufficient to implement it on library side and would be too complex to include as a language feature. So you'll have to use
runBlockingTest
even in the future AFAIU. The biggest problem currently is that it's only available on JVM platform at the moment because the
kotlinx-coroutines-test
library is not multiplatform yet.
j
Javier
10/10/2021, 7:38 PM
Where there is more info about that? I think it has not to be resolved inside Kotlin itself, just the test framework library, no?