voben
10/22/2019, 3:04 PMcontext
. You can try creating a robolectric environment by annotating your test class with @RunWith(RobolectricTestRunner::class)
@RunWith(RobolectricTestRunner::class)
class MyTestClass : AutoCloseKoinTest() {}
Or you could also try mocking the application class in your tests. Maybe something like
@Before
fun before() {
val application = mockk<Application>(relaxed = true)
startKoin {
androidContext(application)
modules(myModules)
}
}