Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Ability to verify getIt configuration #333

Open
nrobi144 opened this issue Jun 23, 2023 · 0 comments
Open

[Feature Request] Ability to verify getIt configuration #333

nrobi144 opened this issue Jun 23, 2023 · 0 comments

Comments

@nrobi144
Copy link

Description

Requesting an unregistered object results in a runtime exception and there is no way to validate the dependency graph.

API example - Koin, a Service Locator for Kotlin

I haven't investigated the get_it implementation extensively enough, but here's an estimation of tasks involved:

  1. Add/Enforce a module structure, where you can retrieve all the bean definitions, for ex. Module.getDefinitions()
  2. Provide mocked/fake beans for the definitions
  3. Try getting the beans. If a definition isn't provided fail the test

There's also an area I'm not sure how to avoid. The last layer, for ex. ViewModel might not be defined in the configuration, so the test will result in a false-positive. Potential solution: go through all files instead of Module.getDefinitions() and mimic getIt<XY>()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant