-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Cannot figure out how to upgrade test to 1.6.0 #3138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Looks like a duplicate of #3120. You do |
Yes seems similar. I spent way too much time on this now, I tried |
Be careful as the |
@NitroG42, we tried very hard for I think your example shows the problem with |
No problem, I wrote this sample before understanding the last posts of #3120 . |
I have a test for an Android ViewModel that uses androidx.paging. Basically it mocks the Api and then asserts that the Pager.flow returns the expected items.
I tried following the Migration guide, but I cannot get it to work.
runTest
instead ofrunBlocking
, is no problem. BothStandardTestDispatcher
andUnconfinedTestDispatcher
seem to do something different from whatTestCoroutineDispatcher
is doing, however. I also tried insertingadvanceUntilIdle()
,runCurrent()
oradvanceTimeBy()
in between steps, to no avail.Here is the test in question: https://github.com/tuskyapp/Tusky/blob/develop/app/src/test/java/com/keylesspalace/tusky/components/timeline/TimelineViewModelTest.kt
Any tips on how I can get this test, and maybe even the disabled one, to work with 1.6 and without deprecations is highly appreciated.
The text was updated successfully, but these errors were encountered: