Join Slack
Powered by
hi, is possible to mock the appContext in common t...
# multiplatform
c
Christos Savlidis
08/28/2023, 1:12 AM
hi, is possible to mock the appContext in common tests, KMM Mobile ?
Christos Savlidis
08/28/2023, 1:14 AM
for example to get a string resource text
i
iXPert12
08/28/2023, 7:22 AM
Sure. In tests you can access context using : ApplicationProvider.getApplicationContext()
https://developer.android.com/reference/androidx/test/core/app/ApplicationProvider
iXPert12
08/28/2023, 7:23 AM
You add this into actual android test code. You don't need context to run tests on iOS>
c
Christos Savlidis
08/28/2023, 9:08 AM
can you give me a sample code or gide please?
Christos Savlidis
08/28/2023, 9:12 AM
this must be run in Android tests or is able to run in common tests?
15
Views
Open in Slack
Previous
Next