diff --git a/core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/util/MainDispatcherRule.kt b/core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/util/MainDispatcherRule.kt index e0e2a2b0a..5d68f6e2a 100644 --- a/core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/util/MainDispatcherRule.kt +++ b/core/testing/src/main/kotlin/com/google/samples/apps/nowinandroid/core/testing/util/MainDispatcherRule.kt @@ -30,6 +30,10 @@ import org.junit.runner.Description * for the duration of the test. */ class MainDispatcherRule( + /** + * Expose testDispatcher to share the scheduler to the test. + * See more in [Documentation](https://developer.android.com/kotlin/coroutines/test#injecting-test-dispatchers) + */ val testDispatcher: TestDispatcher = UnconfinedTestDispatcher(), ) : TestWatcher() { override fun starting(description: Description) = Dispatchers.setMain(testDispatcher)