diff --git a/molecule-runtime/src/jsTest/kotlin/app/cash/molecule/WindowAnimationFrameClockTest.kt b/molecule-runtime/src/jsTest/kotlin/app/cash/molecule/WindowAnimationFrameClockTest.kt index cd05f9af..ee7b0425 100644 --- a/molecule-runtime/src/jsTest/kotlin/app/cash/molecule/WindowAnimationFrameClockTest.kt +++ b/molecule-runtime/src/jsTest/kotlin/app/cash/molecule/WindowAnimationFrameClockTest.kt @@ -15,18 +15,20 @@ */ package app.cash.molecule +import assertk.all +import assertk.assertThat +import assertk.assertions.isLessThan +import assertk.assertions.isPositive import kotlin.test.Test -import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.Job import kotlinx.coroutines.test.runTest -@OptIn(ExperimentalCoroutinesApi::class) class WindowAnimationFrameClockTest { - @Test fun ticks() = runTest { - val job = Job() - WindowAnimationFrameClock.withFrameNanos { - job.complete() + @Test fun ticksWithTime() = runTest { + val frameTimeA = WindowAnimationFrameClock.withFrameNanos { it } + val frameTimeB = WindowAnimationFrameClock.withFrameNanos { it } + assertThat(frameTimeA).all { + isPositive() + isLessThan(frameTimeB) } - job.join() } }