Hii Community, Had an question in KMP Testing what...
# multiplatform
a
Hii Community, Had an question in KMP Testing what is the alternative for this native android code
Copy code
@OptIn(ExperimentalCoroutinesApi::class)
class MainDispatcherRule( val testDispatcher: TestDispatcher = StandardTestDispatcher() ) : TestWatcher() { 
override fun starting(description: Description) { Dispatchers.setMain(testDispatcher) } 
override fun finished(description: Description) { Dispatchers.resetMain() } 
}
a
You mean there is no TestWatcher in the common test? What i do, is to wrap in a decorator function, like override runTest, and then before and after execute the set, reset, simple and it works.
a
@Alexandru Caraus Thanks for you help i got what you said.