how do I correctly configure a multiplatform gradle project tests? I would like to use junit5 on jvm. Currently I get this error `Execution failed for task ':jvmTest'.
No tests found for given includes: [AmountTest.bla](filter.includeTestsMatching)
In a normal jvm project this is fixed by adding
test { userJUnitPlatform() }
to the build script. However I am having a hard time figuring out how to do it in multiplatfom
patrickdelconte
01/19/2020, 12:12 PM
I tried gralde 5.2 and 6.1. Using the IntelliJ multiplatform template as a starting point
patrickdelconte
01/19/2020, 12:16 PM
if I execute the common tests on js platform it works as expected
patrickdelconte
01/19/2020, 12:24 PM
Copy code
implementation(kotlin("test-junit"))
also works. So it is just down to junit5 and the useJUnitPlatform call
s
Shan
01/19/2020, 11:05 PM
Copy code
tasks {
withType<Test> {
useJunitPlatform()
}
}
Does that work for you? iirc
useJunitPlatform()
tells the Test task to use Junit5 by default.
Shan
01/19/2020, 11:06 PM
I am using that setup in my multiplatform projects and it's running tests correctly