Open Egi10 opened 7 months ago
it's using AndroidPlatform
and KoinComponent
. This is why you need to start Koin before using it.
How do I start using Start Koin in commonMain? I always encounter errors when AndroidComponent injects Context.
AndroidComponent injects Context.
this part needs to be in android part only. Check one of the KMP sample to help understand (https://insert-koin.io/docs/quickstart/kmp)
I'm facing an issue with Unit Test. In the Repository (commonMain), there's an access to expect getPlatform, where there's a KoinComponent accessing Context. When I run the unit test, I encounter an error. Should I run the unit test in androidMain?
running unit tests from common code should ask you to run on a platform.
Can you paste your code snippet?
Describe the bug I have an expect / actual fun in KMP which is like this:
To Reproduce While performing unit testing on a class that utilizes getPlatform(), I encountered an error:
I know this is due to using Koin Component and accessing Context in the Android actual function. Is there a way to perform Unit Tests for this without encountering the mentioned error?
Koin module and version: