Configuring kotest in a multiplatform project (and...
# kotest
r
Configuring kotest in a multiplatform project (android + ios with a shared module) and I can't get kotest tests to execute at all. If I add
Copy code
tasks.withType<Test>().configureEach {
  useJUnitPlatform()
}
then only the kotest tests run, but not my old tests. If I don't use that, then my old tests run, but not my kotest tests. Any ideas? I have added the kotest.multiplatform plugin and the kotest framework engine in
commonTest
.
c
What are your "old tests" written in?
useJUnitPlatform
enables JUnit5 support, so if you have JUnit4 tests, they won't run. If you use kotlin.test, migrating from JUnit4 to JUnit5 is just a matter of changing the dependencies
r
My
androidTest
source set does have a reference to junit4 (because AFAIK android uses junit4). I didn't think that affected
commonTest
but looks like it does -- commenting out those androidTest deps results in compile errors.
Swapping those to junit5 with vintage for junit4 support works, my old tests run as spected, but my kotest tests still don't run.