https://kotlinlang.org logo
#ktor
Title
# ktor
j

Jgafner

08/03/2021, 2:45 PM
Hi Is there a way to override an install Plugin (formerly known as Features 🙂 ) in the tests ? More specifically I would like to override Koin installation Thanks
a

Aleksei Tirman [JB]

08/03/2021, 4:09 PM
Could you please share a code example to better understand your problem?
j

Jgafner

08/03/2021, 5:16 PM
There is this ktor-multimodule example in the Koin repo: https://github.com/InsertKoinIO/koin/tree/master/examples/multimodule-ktor Here is the test file: https://github.com/InsertKoinIO/koin/blob/master/examples/multimodule-ktor/app/src/test/kotlin/org/koin/samples/multi_module/app/ApplicationTest.kt In the example there are 2 Koin modules that are loaded with the Ktor install feature. They are both loaded and since we have multiple Koin modules. In our case we would like to avoid loading the modules in the test since some of them start async tasks. Even with Koin override modules all the modules and their component are created and this is something we want to avoid in the test - so I though maybe there is an option to make the test skip installing the koin plugin
a

Aleksei Tirman [JB]

08/03/2021, 5:46 PM
I suggest asking this question in the #koin channel.
j

Jgafner

08/03/2021, 5:47 PM
oh thanks I asked it in the #koin-dev but did not get an answer probably because it was not the right place… my bad 10x again