Created
July 10, 2022 09:40
-
-
Save hongbeomi/d975a40baeb2121d2a699688beba83b1 to your computer and use it in GitHub Desktop.
This file contains 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
class MainDispatcherRule( | |
val testDispatcher: TestDispatcher = UnconfinedTestDispatcher() | |
): TestWatcher() { | |
override fun starting(description: Description) { | |
super.starting(description) | |
Dispatchers.setMain(testDispatcher) | |
} | |
override fun finished(description: Description) { | |
super.finished(description) | |
Dispatchers.resetMain() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment