diff --git a/android/libraries/rib-base/src/test/kotlin/com/uber/rib/core/RibCoroutineWorkerTest.kt b/android/libraries/rib-base/src/test/kotlin/com/uber/rib/core/RibCoroutineWorkerTest.kt index 89c4b3be3..5971fa9d7 100644 --- a/android/libraries/rib-base/src/test/kotlin/com/uber/rib/core/RibCoroutineWorkerTest.kt +++ b/android/libraries/rib-base/src/test/kotlin/com/uber/rib/core/RibCoroutineWorkerTest.kt @@ -190,6 +190,8 @@ class RibCoroutineWorkerTest { assertThat(worker.innerCoroutineCompleted).isFalse() assertThat(worker.onStopRan).isFalse() test(worker) { + // Quick check that suspend functions can be called inside this block + delay(0) // Assert onStart and inner coroutine started but have not finished (it has delays) assertThat(it.onStartStarted).isTrue() assertThat(it.innerCoroutineStarted).isTrue() diff --git a/android/libraries/rib-test/src/main/kotlin/com/uber/rib/core/TestRibCoroutineWorker.kt b/android/libraries/rib-test/src/main/kotlin/com/uber/rib/core/TestRibCoroutineWorker.kt index 13047244a..f441c0034 100644 --- a/android/libraries/rib-test/src/main/kotlin/com/uber/rib/core/TestRibCoroutineWorker.kt +++ b/android/libraries/rib-test/src/main/kotlin/com/uber/rib/core/TestRibCoroutineWorker.kt @@ -39,7 +39,7 @@ import kotlinx.coroutines.test.runCurrent @OptIn(ExperimentalCoroutinesApi::class) public inline fun TestScope.test( worker: T, - crossinline testBody: TestScope.(T) -> Unit, + testBody: TestScope.(T) -> Unit, ) { val dispatcher = StandardTestDispatcher(testScheduler) val handle = bind(worker, dispatcher)