https://kotlinlang.org logo
Title
i

igor.wojda

07/19/2022, 9:51 AM
Hey Assuming we need to advance coroutine time using
advanceUntilIdle()
method. I wonder where this method belongs in BDD (
When
or
Then
block?)
@Test
    fun `test something`() = runTest {
        // given
        setup code

        // when
        subject.init()
        advanceUntilIdle()

        // then
        verify something
    }
or
@Test
    fun `test something`() = runTest {
        // given
        setup code

        // when
        subject.init()

        // then
        advanceUntilIdle()
        verify something
    }