Provide Default dispatcher for instrumented tests

Change-Id: I488a9b9d9d3864ce9496614ab35332ec19d06bcc
pull/750/head
Don Turner 2 years ago
parent b245334a18
commit d319264ef0

@ -25,4 +25,5 @@ android {
dependencies {
api(project(":core:data"))
implementation(project(":core:testing"))
implementation(project(":core:common"))
}

@ -26,6 +26,7 @@ dependencies {
api(project(":core:datastore"))
api(libs.androidx.dataStore.core)
implementation(libs.protobuf.kotlin.lite)
implementation(project(":core:common"))
implementation(project(":core:testing"))
}

@ -17,6 +17,7 @@
package com.google.samples.apps.nowinandroid.core.testing.di
import com.google.samples.apps.nowinandroid.core.network.Dispatcher
import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.Default
import com.google.samples.apps.nowinandroid.core.network.NiaDispatchers.IO
import com.google.samples.apps.nowinandroid.core.network.di.DispatchersModule
import dagger.Module
@ -35,4 +36,10 @@ object TestDispatchersModule {
@Provides
@Dispatcher(IO)
fun providesIODispatcher(testDispatcher: TestDispatcher): CoroutineDispatcher = testDispatcher
@Provides
@Dispatcher(Default)
fun providesDefaultDispatcher(
testDispatcher: TestDispatcher,
): CoroutineDispatcher = testDispatcher
}

Loading…
Cancel
Save