Paul Woitaschek
05/03/2022, 6:30 AMprivate fun contentFlow(): Flow<Int> {
return combine(
flowOf(Unit),
flowOf(2).onStart { emit(1) }
) { _, b ->
b
}.onEach { println(it) }
}
@Test
fun turbineCollect() = runTest {
contentFlow()
.test {
check(awaitItem() == 1)
cancelAndIgnoreRemainingEvents()
}
}
@Test
fun regularCollect() = runTest {
check(contentFlow().toList() == listOf(1, 2))
}
https://github.com/cashapp/turbine/issues/112Trevor Stone
05/03/2022, 5:53 PM