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

Vishnu Shrikar

11/18/2023, 9:19 AM
I am in a multiplatform project with Kotest and it cannot find withData(), I am using a free spec. Any idea why?
e

Emil Kantis

11/18/2023, 9:23 AM
Did you add a dependency in
io.kotest:Kotest-framework-datatest
?
v

Vishnu Shrikar

11/18/2023, 9:27 AM
uhhh... I got like this....
e

Emil Kantis

11/18/2023, 9:35 AM
Looks like you don’t. As mentioned here, a separate dependency is needed. https://kotest.io/docs/framework/datatesting/data-driven-testing.html
v

Vishnu Shrikar

11/18/2023, 9:39 AM
right, so I did that now and it is still not working
Copy code
val commonTest by getting {
            dependencies {
                implementation(libs.kotest.framework.engine)
                implementation(libs.kotest.assertions.core)
                implementation(libs.kotest.framework.datatest)

            }
        }
this is my new import
Copy code
kotest-framework-engine = { module = "io.kotest:kotest-framework-engine", version.ref = "kotest" }
kotest-assertions-core = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }
kotest-framework-datatest = { module= "io.kotest:Kotest-framework-datatest", version.ref = "kotest" }
kotest-runner-junit5-jvm = { module = "io.kotest:kotest-runner-junit5-jvm", version.ref = "kotest" }
this is the TOML
e

Emil Kantis

11/18/2023, 9:45 AM
Did you reload gradle config in IntelliJ?
v

Vishnu Shrikar

11/18/2023, 9:48 AM
yeah that got the error to show up. I copy pasted a capital K but gradle was still building fine, I clicked on the elephant but I think it may have glitched and I did not notice. Adding the dependancy was the solution here. Thank you so much
e

Emil Kantis

11/18/2023, 9:50 AM
sorry about the capitalization, was on my phone 🙂 no problem!