AntoineJojo
05/04/2018, 12:47 PMorg.koin.error.AlreadyStartedException: Koin is already started. Run startKoin only once or use loadKoinModules
when I define my instrumented test like that:
@Before
fun setUp() {
val mockModule = applicationContext {
bean { mockRepository as Repository }
}
startKoin(modules + mockModule)
}If I use
loadKoinModules
, the modules are not loaded, only the one defined in my Application class.
Any idea? Do you have some example of instrumented test mocking some Koin modules?