Yeah, Koin kindda does that when you have android ...
# koin
v
Yeah, Koin kindda does that when you have android dependencies, and its pretty annoying. Mostly things related to
context
. You can try creating a robolectric environment by annotating your test class with
@RunWith(RobolectricTestRunner::class)
Copy code
@RunWith(RobolectricTestRunner::class)
class MyTestClass : AutoCloseKoinTest() {}
Or you could also try mocking the application class in your tests. Maybe something like
Copy code
@Before
    fun before() {
        val application = mockk<Application>(relaxed = true)
        startKoin {
            androidContext(application)
            modules(myModules)
        }
    }