I have a gradle module that is kotlin multiplatform. It's a pretty small networking library, but now I want to write some tests for it. It seems like my IDE (android studio) runs tests just fine in /src/test and /src/commonTest. Should I prefer one over the other?
m
mbonnin
05/27/2024, 5:04 PM
I wasn’t expecting
test
to work, I’d do
commonTest
always
mbonnin
05/27/2024, 5:04 PM
Are you running your tests with the Gradle runner?
c
Colton Idle
05/27/2024, 5:10 PM
not sure actually. i just hit the little green arrow next to my test class in Studio. 🙈
m
mbonnin
05/27/2024, 5:13 PM
It’s here
mbonnin
05/27/2024, 5:13 PM
I always use Gradle. IDEA can behave surprinsigly otherwise
c
Colton Idle
05/27/2024, 5:44 PM
hm. yep. thats what i have set
c
Chanjung Kim
05/28/2024, 1:46 AM
src/test is the directory detected by the Android Gradle plugin, while src/commonTest is the one used by KMP. You can see that the tests in src/test only run Android local unit tests.