Max
07/01/2024, 5:48 PMorg.jetbrains.kotlin:kotlin-test
)
• JUnit (org.jetbrains.kotlin:kotlin-test-junit
)
• MockK (io.mockk:mockk-common
)
in my AndroidTest source set. Can someone tell me what is the right sourceSet
for this? I tried androidMain
and androidNativeTest
, but if i add the dependencies there, they are not available in my src/androidTest/kotlin
directory. How would the right setup be?jw
07/01/2024, 5:53 PMsrc/androidUnitTest/
or src/androidInstrumentedTest/
directories now. See https://kotlinlang.org/docs/multiplatform-android-layout.htmljw
07/01/2024, 5:53 PMjw
07/01/2024, 5:54 PMdependencies
task and looking for the matching configuration namesjw
07/01/2024, 5:55 PMMax
07/01/2024, 6:24 PMandroidUnitTest
source set differently than commonMain
, iosMain
or androidMain
. Had to add `by getting`:
val androidUnitTest by getting
androidUnitTest.dependencies {
implementation(libs.kotlin.test)
implementation(libs.kotlin.test.junit)
implementation(libs.mockk)
}
Now it works. Thx!Michael Krussel
07/01/2024, 8:26 PMMain
there is normally another one with Test
. commonMain
, commonTest
, iosMain
, iosTest
. Android is special, since it has two source sets for tests.