How to Mock Kotlin LifecycleCoroutineScope for Unit Test?

Viewed 731

How can I mock the following function act.

class Some {
    internal lateinit var coroutineScope: LifecycleCoroutineScope

    ...

    fun act() {
        coroutineScope.launch {
            ...
        }
    }
}

I am using mockk and kotlinx-coroutines-test for unit-testing this. But it can only mock CoroutineScope and not LifecycleCoroutineScope.

0 Answers
Related