Skip to content

Instantly share code, notes, and snippets.

@cdmunoz
Created January 24, 2020 02:45
Show Gist options
  • Save cdmunoz/34c67bf2d44f855b7552d6ff02a60dd2 to your computer and use it in GitHub Desktop.
Save cdmunoz/34c67bf2d44f855b7552d6ff02a60dd2 to your computer and use it in GitHub Desktop.
class MyEspressoIdlingResourceRule: TestWatcher() {
private val idlingResource = EspressoIdlingResource.countingIdlingResource
override fun starting(description: Description?) {
IdlingRegistry.getInstance().register(idlingResource)
super.starting(description)
}
override fun finished(description: Description?) {
IdlingRegistry.getInstance().unregister(idlingResource)
super.starting(description)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment