KMM project in Android Studio shows `androidTest` ...
# multiplatform
m
KMM project in Android Studio shows
androidTest
everywhere. I can't find
commonTest
. when I change project view to
Project
I can see
commonTest
but when I want to run tests am given options:
android:(testDebugUnitTest)
and
android:(testReleaseUnitTest)
. how to run common tests as plain JVM Kotlin tests?
e
testDebugUnitTest and testReleaseUnitTest are local JVM tests. the device instrumentation tests end up in androidAndroidTest with KMM
m
why then are they prefixed with
android:
? that's what confuses me
e
they're built for the android target (and will run with a stub android framework). if you had a jvm target, that would show up separately
m
how to write and run plain Kotlin tests?
l
@Marko Novakovic the tests always has to run in something. So you run the test for the specific platform, which includes all the common tests.
In my project I have about 1200 tests, most of them in common. When I run the JVM, Native and JS tests, I end up running over 3000 tests because all the common tests run multiple times. This is what you want, because you need to make sure that your common code works on all platforms.
m
I see. now it makes sense. thanks!