You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Replaced @RunWith(RobolectricTestRunner::class) by @RunWith(AndroidJUnit4::class). robolectric:4.x is supporting the AndroidJUnit4 test runner, ActivityTestRule, and Espresso for interacting with UI components. And RobolectricTestRunner class is only for robolectric:3.x :).
Added TestCoroutineRule that will help to control and pass TestCoroutineDispatcher to any production classes which
need a CoroutineDispatcher, for example the ViewModel. This will helps us to use pause and resume the coroutine in the ViewModel.
The text was updated successfully, but these errors were encountered:
Improvements in Unit tests
@RunWith(RobolectricTestRunner::class)
by@RunWith(AndroidJUnit4::class)
.robolectric:4.x
is supporting the AndroidJUnit4 test runner, ActivityTestRule, and Espresso for interacting with UI components. AndRobolectricTestRunner
class is only forrobolectric:3.x
:).http://robolectric.org/blog/2018/10/25/robolectric-4-0/
TestCoroutineRule
that will help to control and passTestCoroutineDispatcher
to any production classes whichneed a
CoroutineDispatcher
, for example the ViewModel. This will helps us to usepause
andresume
the coroutine in the ViewModel.The text was updated successfully, but these errors were encountered: