All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.org.koin.test.mock.Declare.kt Maven / Gradle / Ivy

package org.koin.test.mock

import org.koin.core.qualifier.Qualifier
import org.koin.mp.KoinPlatformTools
import org.koin.test.KoinTest
import org.koin.test.get

inline fun  KoinTest.declare(
    qualifier: Qualifier? = null,
    noinline instance: () -> T,
): T {
    val koin = KoinPlatformTools.defaultContext().get()
    koin.declare(instance(), qualifier, allowOverride = true)
    return get(qualifier)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy