Comments (6)
Thanks @arnaudgiuliani ! Sure, The issue just affects when the koin-androidx-compose
is upgraded from v3.5.0 -> v3.5.3/4. The code contains some Automation Test in Espresso, and for some reason the second Test Case of the same Test Class fails when the ViewModelFactory tries to get the instance of the ViewModel. In order to provide more information, this is the KoinTestRule
used on the Test Class (based on tutorials):
class KoinTestRule(
private val modules: List<Module> = emptyList()
) : TestWatcher() {
private val modulesByDefault = listOf(dataModule, useCaseModule, viewModelModule, appModule)
override fun starting(description: Description) {
startKoin {
androidContext(InstrumentationRegistry.getInstrumentation().targetContext.applicationContext)
modules(modulesByDefault + modules)
}
}
override fun finished(description: Description) {
stopKoin()
}
}
And this is the invocation on the Test Class:
private val instrumentedTestModule = module {
factory { getMockDataLocalSource() }
factory { getMockQuestions(questionJson) }
...
}
override val koinTestRule: KoinTestRule
get() = KoinTestRule(
modules = listOf(instrumentedTestModule)
)
The first TestCase works fine, but the second one fails on this. It happens to all the Test Classes. It was working fine until now. Thanks in advance
from koin.
Can you detail it a bit more?
from koin.
@arnaudgiuliani Do you have any updates regarding this issue? Our tests are also affected by the same issue, therefore we're currently not able to update the koin version.
from koin.
Hi @arnaudgiuliani, any update about this issue? Thanks in advance
from koin.
weird, seems that VM factory is invoked after scope closing 🤔
from koin.
can anyone help by providing a test project for that? @kasim-canol-sz @javiercamarenatriguero
from koin.
Related Issues (20)
- No static method makeOptions$default(Lorg/koin/core/module/Module;ZZILjava/lang/Object;)Lorg/koin/core/definition/Options; in
- KoinAppAlreadyStartedException after changing theme HOT 5
- > Task :composeApp:compileKotlinIosSimulatorArm64 FAILED error: Could not find "org.jetbrains.compose.annotation-internal:annotation" HOT 2
- Upgrading Koin `3.5.3` -> `3.5.4` removes dep on `kotlin-test` HOT 1
- No sources published for various modules of Koin 3.5.4 HOT 2
- Support default value in constructor DSL
- Docs what does int mean createdAtStart, to be created at start (or when you want)
- Kotlin Multiplatform ViewModel support in Koin HOT 3
- Missing Source Code HOT 2
- Add Object support for koin annotation.
- Does koin support component lifecycle management? HOT 1
- Question - activityScope and activityRetainedScope
- ConcurrentModificationException iOS crash on koin 3.5.6 HOT 2
- KoinAppAlreadyStartedException after closing the app and relaunching it quickly HOT 2
- Support circuit for code gen HOT 1
- SLF4JLogger is using the wrong level when printing to logger
- ViewModelScoped Dependency as a constructor argument HOT 2
- Cannot run on iOS HOT 2
- koin.loadModules wrong api signature. (3.5.6) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from koin.