gmaciel
06/29/2020, 11:39 AMThis job has not completed yet
, any ideas what i'm doing wrong here:
@Test
fun test() = runBlockingTest {
val mutableStateFlow = MutableStateFlow(0)
mutableStateFlow.value = 1
mutableStateFlow.value = 2
val result = mutableListOf<Int>()
mutableStateFlow.collect {
result.add(it)
}
assertEquals(listOf(0, 1, 2), result)
}
Dominaezzz
06/29/2020, 11:58 AMgildor
06/29/2020, 12:17 PMgmaciel
06/29/2020, 12:20 PMDaniel
07/01/2020, 6:10 PMDaniel
07/01/2020, 6:13 PMDominaezzz
07/01/2020, 6:23 PMDaniel
07/01/2020, 9:25 PMDaniel
07/01/2020, 9:26 PMDominaezzz
07/01/2020, 10:46 PMtake(3)
takes the first three emissions and then terminates collection.