Have a question: I'm ready to start adding unit te...
# multiplatform
d
Have a question: I'm ready to start adding unit tests for the composables in my KMP project. The project was generated from the Kotlin Multiplatform Wizard, but I'm not seeing an androidTest directory in the project. Where should I be adding these tests?
l
Inside composeApp, you add new directory Like this exemple
d
I've managed to get a minimal setup by adding this to my composeApp/build.gradle.kts file, within the sourceSets block:
val androidUnitTest by _getting_ *{*
dependencies *{*
implementation(_libs_._junit_)
implementation(_libs_._kotlin_._test_)
implementation(_libs_._androidx_._test_._core_)
implementation(_libs_._androidx_._test_._junit_)
implementation(_libs_._compose_._ui_._test_._junit_)
implementation(_libs_._androidx_._espresso_._core_)
}
}
Now the issue I'm seeing is that, when I run the tests, they're not running with the Android emulator and I get: FINGERPRINT must not be null java.lang.NullPointerException: FINGERPRINT must not be null
I just feel like it shouldn't be this difficult to setup, but there's no consistency between the various example projects out there.