<withContext(Dispatchers.IO) keeps launching on De...
# stackoverflow
u
withContext(Dispatchers.IO) keeps launching on DefaultDispatchers I am using Robolectric to unit test. I have a Worker that I want to launch on Dispatchers.IO In order to use my own dispatcher, I pass it as a parameter in the constructor. To do so, I use a Factory class CacheWorkerFactory(private val coroutineDispatcher: CoroutineDispatcher = Dispatchers.IO) : WorkerFactory() { override fun createWorker( appContext: Context, workerClassName: String, workerParameters: WorkerParameters ): ListenableWorker? {...