https://kotlinlang.org logo
#getting-started
Title
# getting-started
y

Yatin Shelke

02/27/2022, 12:10 AM
Hi, i am new to kotlin multiplatform. Started with this sample Build a Full Stack Web App with Kotlin Multiplatform, and was able to get it running. However, when i tried to generate a test for the get method in the example in Server.kt, i see that the imports in the generated test do not get resolved. What dependencies do i need to add to build.gradle.kts to get this working? Would be nice to write tests along with the code. See screenshot that shows imports in red.
a

Andromadus Naruto

02/27/2022, 9:05 AM
Did you enabled Testing while creating the project? It seems that some dependencies are missing...
a

Alex Edwards

02/27/2022, 9:27 PM
It may not be the case in current versions but I had to explicity add the test lib in the relevant language
Copy code
val jsTest by getting {
            dependencies {
                implementation(kotlin("test-js"))
y

Yatin Shelke

03/01/2022, 12:50 PM
Thanks both. The project was downloaded from gitlab, so i guess i will try to recreate it from scratch. I will also try setting dependency for specific language.