Davide Giuseppe Farella
02/18/2023, 7:15 AMprivate val appScope = TestScope()
private val sut = Sut(appScope)
@Test
fun `some test`() = appScope.runTest { ... }
Now, with Kotest, I did this:
class MyTest : BehaviorSpec({
Given("abc") {
val sut = Sut(testScope)
It worked, till I needed to call advanceUntilIdle()
(after this code) so, to achieve that, I had to add coroutineTestScope = true
and it became
class MyTest : BehaviorSpec({
coroutineTestScope = true
Given("abc") {
val sut = Sut(testScope)
But this doesn’t seem to work correctly, as the Flow internal to my SUT never emits.
I’ll drop my SUT in the 🧵