I am having the same issue in a compose multiplatform project and I cannot seem to be able to solve.
@Ian Lake I am trying to write unit tests (not instrumentation) for viewmodels that make use of safe navigation arguments via the
SavedStateHandle.toRoute
api. My tests are in
commonTest
target. My app is targeting android and ios (iosX64, iosArm64 and iosSimulatorArm64).
androidx.navigation:navigation-testing
does not seem to be compatible with ios. I have tried to use the
androidUnitTest
with Robolectric but I get
java.lang.NullPointerException: encode(...) must not be null
I have not tried to create a new jvm target and write tests there because I am not needing it and creating it would mean a number of actual implementations that would not serve any purpose.
I could not find any source online with a concrete example, any help or guidance is more than welcome.