-
Notifications
You must be signed in to change notification settings - Fork 0
Using runBlockingTest
Devrath edited this page Jul 3, 2021
·
1 revision
- We use
runBlockingTest
to test co-routines that start withlaunch
andasync
. - We use this to test the
suspend functions
- Usually the co-routines involve
delay
so simulating this in a test is essential since it is different than normal functions that we test. - Any calls to the delay will automatically advance virtual time by the amount of delay
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.0'