https://kotlinlang.org logo
#kotest
Title
# kotest
s

starke

12/08/2023, 9:43 PM
Has anyone had success using kotest in a kotlin multiplatform (android, ios, jvm server) project that is using the new hierarchy template stuff that was added in kotlin 1.9.20? I’m getting some strange errors when attempting to apply the
io.kotest.multiplatform
plugin to my
shared
build file so that I can use kotest in
commonTest
. for example:
Unresolved reference: androidTarget
Copy code
kotlin {
    iosX64()
    iosArm64()
    iosSimulatorArm64()

    androidTarget {
        compilations.all {
            kotlinOptions.jvmTarget = libs.versions.androidJvm.get()
        }
    }

    jvm()
    
    sourceSets {
        ...
        
        commonTest.dependencies {
            implementation(libs.kotest.assertions.core)
            implementation(libs.kotest.framework.engine)
        }

        jvmTest.dependencies {
            implementation(libs.kotest.runner.junit5)
        }
    }
}
and if I remove the
androidTarget
block, it complains about
commonTest.dependencies {
so I’m guessing the multiplatform plugin probably isn’t updated to work with this new structure yet 🤔
14 Views