Does anyone know why kotlin-test is not being publ...
# testing
b
Does anyone know why kotlin-test is not being published with gradle metadata and instead requires adding kotlin-test-common, kotlin-test-js, and kotlin-test-annotations separately?
👀 1
b
I'm aware, but it never worked for me in kmp setup without adding target artifacts too
m
I think it works for me, or maybe only for
commonTest
tests, let me check again
b
You mean without kotlin-test-js and kotlin-test-junit(5) dependencies?
Native targets have kotlin-test embedded into them without having to declare a dependency
m
This works for me:
Copy code
plugins {
  id("org.jetbrains.kotlin.multiplatform").version("1.9.21")
}

kotlin {
  jvm()
  macosArm64()
  js(IR) {
    this.nodejs()
  }
  
  sourceSets {
    getByName("commonTest") {
      dependencies {
        implementation(kotlin("test"))
      }
    }
  }
}
Screenshot 2024-01-03 at 11.26.26.png
b
Hmm, I'll have to retest this on my own projects. Maybe things have improved in recent versions and docs are just outdated
Thanks!
m
Sure thing! Let me know how that goes
b
However I'm still curious what was the reason behind needing the old setup.
âž• 1