guys, is it possible to write tests in the `common...
# multiplatform
d
guys, is it possible to write tests in the
commonTest
? what platform will run it?
g
you can use kotlin.test, looks similar to junit
d
i have a problem. i can't resolve any dependency from my commonMain module inside of test
g
You've to use commonTest
d
yes. i'm trying. but can't resolve any lib dependency. like koin, coroutines etc
i tried also this:
Copy code
val commonTest by getting {
            dependsOn(commonMain)
...
didn't help
g
val commonTest by getting
it's enough
not enough information to help there, maybe it's an OSS project?
d
it's a kmm project created by android studio wizard
m
I added deps directly to the
commonTest
and then gradle task
shared:test
to run them. Deps are
test-common
and
test-annotations-common
d
thanks. i wanted to avoid repeating the dependencies
m
For me those are different than the deps in
commonMain
, no
test
deps there
d
i mean a have to add koin, coroutines and all other stuff directly to the commonTest module to get it to work
m
Ah, right. I misunderstood 👍 Not that far yet with the testing myself
I tested quickly whether deps are resolved on the
commonTest
sources from `commonMain`: seems like it works. I don’t have a
dependsOn
even 🤔
Copy code
val commonTest by getting {
            dependencies {
                implementation(kotlin(Deps.Kotlin.Test.common))
                implementation(kotlin(Deps.Kotlin.Test.annotations))
            }
        }
g
I agree commonTest should already have all commonMain dependencies, a bit weird to have to repeat 😕
m
Did you figure it out?