reset

fun reset()

Immediately resets the factory function to its default.

Samples

import dispatch.android.espresso.MainImmediateIdlingCoroutineScope
import dispatch.android.viewmodel.ViewModelScopeFactory
import dispatch.core.MainImmediateCoroutineScope
import dispatch.internal.test.Sample5
import dispatch.test.TestProvidedCoroutineScope
import kotlinx.coroutines.ExperimentalCoroutinesApi
fun main() { 
   //sampleStart 
   class MyEspressoTest {

  @Before
  fun setUp() {
    ViewModelScopeFactory.set { MainImmediateIdlingCoroutineScope() }
  }

  @After
  fun tearDown() {
    ViewModelScopeFactory.reset()
  }
} 
   //sampleEnd
}

Sources

Link copied to clipboard