Hi all! Should I be able to run Kotest 6.x in a G...
# kotest
g
Hi all! Should I be able to run Kotest 6.x in a Gradle 9.x build without using JUnit runner and related libraries? It looks like I should, but the JVM examples all still use the JUnit runner and while I can run
gradle kotest
successfully I can’t run
gradle build
without it failing because it can’t find any tests. I’m sure I’ve got something configured wrong in Gradle, but I haven’t been able to find an example build script. kotest.io Setup | Kotest The Kotest test framework is supported on JVM, Javascript and Native.
Also, along the same lines is my assumption that using the Kotest gradle plugin is the preferred way.
s
Gradle build will run junit if you have junit configured in gradle
And with gradle 9 it fails it there's no tests
g
Hmm… I didn’t quite understand that JUnit is the default for the
test
task. I thought
test
could be wired up to use Kotest or JUnit. I got past my issue by putting this in my build:
Copy code
tasks.test {
    enabled = false
}

tasks.named("build") {
    dependsOn("kotest")
}

tasks.named("check") {
    dependsOn("kotest")
}
My builds work correctly now.
👍🏻 1