Kamil Kalisz
01/05/2025, 8:58 PMstringResource
and tests. I have kmm compse app with iOS/Android/Wasm targets.
stringResource works perfectly fine with each of the target apps. But i have issues with tests. On Android (Instrumentation variant, connectedAndroidTest) stringResource
returns proper values.
But the same test on wasm and iOS (iosSimulatorArm64Test and wasmJsTest) results error as value returned by stringResource
is empty.
Is this expected behaviour or maybe i messed with something? If yes is there any possibility to easily mock stringResource
? I'm expecting it's related to LocalResourceReader
class ExampleTest {
@OptIn(ExperimentalTestApi::class)
@Test
fun myTest() =
runComposeUiTest {
setContent {
MenuEntry(stringResource(Res.string.main_menu_play)) {}
}
onNodeWithText("Play").performClick()
}
}