CoroutineScope.launch doesn't work in TestScope

Viewed 386

I have a function that collects a flow and does other operations through launching other coroutines, in my tests for that function it looks like none of my coroutines launches. is there something I am missing here?

class Tax(
    private val coroutineScope: CoroutineScope,
) {
    fun operate() {
        coroutineScope.launch {
            // some work done here 
        }
    }
}

// My Test class 
@Test
fun `test operate`() = runTest {
    val tax = Tax(this)
    tax.operate()
    // verify something with in the coroutineScope.launch always fails
}
0 Answers
Related