Mihai Batista
10/02/2024, 3:30 PMModule.verify()
(koin 4.0.0) doesn’t report missing dependency when binding to an interface.
Even though in the following setup dataStore
is not declared, the test passes.
single<AuthRepository> {
AuthRepositoryImpl(
dataStore = get()
)
}
In the test logs there is only this mention about AuthRepository
:
|-> definition [Singleton: 'com.example.koinscope.model.repositories.AuthRepository']
| bind types: [class com.example.koinscope.model.repositories.AuthRepository]
Does verify
require additional setup to properly check the dependencies of the concrete implementations?Pedro Francisco de Sousa Neto
10/02/2024, 5:42 PMsingle(::AuthRepositoryImpl)
Mihai Batista
10/04/2024, 9:36 AMMihai Batista
10/04/2024, 9:49 AMverify
for that case?Pedro Francisco de Sousa Neto
10/04/2024, 11:28 AMverify
function just check your parameters if you're using Koin Constructor DSL. There is a lack of implementation, I guess. 😢
To check dependencies without migrating to constructor dsl you need to use the checkDependencies. But is deprecated.
@arnaud.giuliani one more person suffering with this scenario again. FYIarnaud.giuliani
10/04/2024, 1:50 PMsingle {AuthRepositoryImpl(get()) } bind AuthRepository::class
arnaud.giuliani
10/04/2024, 1:50 PMMihai Batista
10/04/2024, 2:05 PMdataStore
dependency. I’ve noticed that it doesn’t check if there is a declaration with that qualifier, only that there is a definition for that type, is this something currently missing?
For ex:
single {
AuthRepositoryImpl(
dataStore = get(named("myStore2"))
)
} bind AuthRepository::class
would pass, even if there is only a dataStore named myStore1
declared.arnaud.giuliani
10/04/2024, 3:07 PM