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
{{ message }}
This repository was archived by the owner on Aug 16, 2023. It is now read-only.
Running it as recommended, without any testing context will produce this:
Same bug exists in the finished_code module of the codelab project.
I fixed it by upgrading in coroutines-codelab build.gradle the coroutines_android_version to '1.6.3' and using the new runTest scope:
Also perhaps note that advanceTimeBy is deprecated since 1.6. Per the deprecation message, the recommended replacement is to advance the scheduler and runCurrent, manually, e.g.:
The recommended first test case won't work any more:
@test
fun whenMainClicked_updatesTaps() {
subject.onMainViewClicked()
Truth.assertThat(subject.taps.getValueForTest()).isEqualTo("0 taps")
coroutineScope.advanceTimeBy(1000)
Truth.assertThat(subject.taps.getValueForTest()).isEqualTo("1 taps")
}
Running it as recommended, without any testing context will produce this:
Same bug exists in the finished_code module of the codelab project.
I fixed it by upgrading in coroutines-codelab build.gradle the coroutines_android_version to '1.6.3' and using the new runTest scope:
Also perhaps note that advanceTimeBy is deprecated since 1.6. Per the deprecation message, the recommended replacement is to advance the scheduler and runCurrent, manually, e.g.: