-
Notifications
You must be signed in to change notification settings - Fork 67
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
Use Settings in Unit Testing #194
Comments
Calling the |
Hey guys, I didn't quite understand the answer. In my case, I'm doing unit testing at CommonMainTest in KMP(old KMM). I tried using KoinTest and Mockative and both returned the same error presented initially. @russhwolf could you explain better how to resolve this issue when testing? |
Is there a timeframe for when 1.2 would be released? |
1.2 is now out. You can now do something like this in a test val context: Context = ...
SettingsInitializer().create(context)
val settings = Settings()
// do something with settings Alternatively, make your helper class injectable:
then you can do |
Hello, I have created this helper to save userName in Settings. I get and set the details in some viewModels.
I created the following unit test:
And I get this error:
How can I use the helper in Unit Testing?
The text was updated successfully, but these errors were encountered: