Hi, how do we inject using koin in iosTest (KMM) ?...
# multiplatform
a
Hi, how do we inject using koin in iosTest (KMM) ? here is a test am working on
Copy code
@Test
    fun game_mode_returns_default_value_when_no_value_is_set() {
        val userDefaults = NSUserDefaults.standardUserDefaults
        userDefaults.removeObjectForKey(ConfigurationRepository.CONFIGURATION_FILE)

        val configurationRepository: ConfigurationRepository = get()

        val defaultGameMode = configurationRepository.gameMode

        assertEquals(GameMode.MODE_ONE, defaultGameMode)
    }
am getting Unresolved reference. for
Copy code
get()
i have also tried
Copy code
... by inject()
here is the gradle dependency
Copy code
iosTest.dependencies {
            implementation(libs.kotlin.test)
            implementation(libs.koin.test)
            implementation("co.touchlab:stately-common:2.0.5")
        }
j
Is your test subclassing
KoinTest
?
a
was missing this part
Copy code
: KoinTest
thanks for pointing me to the right direction 😉
👍 1