Sergio Crespo Toubes

    Sergio Crespo Toubes

    3 years ago
    Hello, can someone help me? How can i test method like this?
    fun loadData() = MainScope().launch {
    
    }
    dector

    dector

    3 years ago
    With
    kotlinx-coroutines-test
    library (https://github.com/Kotlin/kotlinx.coroutines/tree/master/kotlinx-coroutines-test) there a few ways to do it: using
    Dispatchers.setMain()
    or launching coroutine context to
    launch()
    function.
    Sergio Crespo Toubes

    Sergio Crespo Toubes

    3 years ago
    Thank you !!