You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when using Koin Isolated Context like the Koin documentation suggests:
// Get a Context for your Koin instance
object MyIsolatedKoinContext {
val koinApp = koinApplication {
// declare used modules
modules(coffeeAppModule)
}
val koin = koinApp.koin
}
How would you overwrite the koinApp in your unit tests to switch declarations? I am currently running into the problem that I am not able to use different implementations in my unit tests because I can only fill the default Koin context from my understanding and have no option to switch out this isolated context.
Do you have any suggestions?
Edit: I am using field injection via overwritten getKoin() from the KoinComponent function that uses my isolated context
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
when using Koin Isolated Context like the Koin documentation suggests:
How would you overwrite the koinApp in your unit tests to switch declarations? I am currently running into the problem that I am not able to use different implementations in my unit tests because I can only fill the default Koin context from my understanding and have no option to switch out this isolated context.
Do you have any suggestions?
Edit: I am using field injection via overwritten
getKoin()
from theKoinComponent
function that uses my isolated contextBeta Was this translation helpful? Give feedback.
All reactions