Created
June 4, 2021 13:13
-
-
Save manuelvicnt/d9a71e088c956fa4fc9343d931af5a5b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// androidTest/projectPath/TestCoroutinesDispatchersModule.kt file | |
@TestInstallIn( | |
components = [SingletonComponent::class], | |
replaces = [CoroutinesDispatchersModule::class] | |
) | |
@Module | |
object TestCoroutinesDispatchersModule { | |
@DefaultDispatcher | |
@Provides | |
fun providesDefaultDispatcher(): CoroutineDispatcher = | |
AsyncTask.THREAD_POOL_EXECUTOR.asCoroutineDispatcher() | |
@IoDispatcher | |
@Provides | |
fun providesIoDispatcher(): CoroutineDispatcher = | |
AsyncTask.THREAD_POOL_EXECUTOR.asCoroutineDispatcher() | |
@MainDispatcher | |
@Provides | |
fun providesMainDispatcher(): CoroutineDispatcher = Dispatchers.Main | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment