Category: Database, android

Note: this was assembled with koin version 2.0.1, more recent versions have changed some things. This project was initially set up with Dagger as a dependency injection mechanism and is not modularised.

Luckily the way to test this in Koin is quite easy and we have a CI that runs all the tests before letting us release a version (either test or production).

Each new feature will have a new module and this is added to the list of modules defined at the beginning.

Another advantage that koin offers us in this case is not having to declare the injected elements as lateinit var making them clearer and safer, using the by viewModel delegate the viewmodel will be instantiated in a lazy way, that is, only in case it is needed.

Related Articles