Hannes
01/03/2020, 6:45 PMcommonTest
. In my build.gradle
i have the following config:
kotlin {
...
sourceSets {
...
commonTest {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-test-common'
implementation 'org.jetbrains.kotlin:kotlin-test-annotations-common'
}
}
}
}
However, if I run a test in src/commonTest/kotlin/my/package/FooTest.kt
which looks like this
import kotlin.test.Test
import kotlin.test.assertEquals
class FooTest {
@Test
fun filterState(){
assertEquals(1, 2)
}
}
I get
Unresolved reference: Test
e: ... /src/commonTest/kotlin/my/package/FooTest.kt: (3, 20): Unresolved reference: Test
e: ... /src/commonTest/kotlin/my/package/FooTest.kt: (4, 20): Unresolved reference: assertEqualsAny idea what I have misconfigured?
grandstaish
01/03/2020, 6:48 PMjava
instead of kotlin
Hannes
01/03/2020, 6:49 PMkotlin
Kris Wong
01/03/2020, 6:59 PMHannes
01/03/2020, 7:06 PMcommonMain
, I just have a bunch of pure kotlin code in this library project that has no expected / actual
platform specific implementation and therefore also no jvmTest
etc.Kris Wong
01/03/2020, 7:11 PMHannes
01/03/2020, 7:15 PMkotlin {
jvm()
js()
macosX64()
iosArm32()
iosArm64()
iosX64()
...
sourceSets {
...
commonTest {
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-test-common'
implementation 'org.jetbrains.kotlin:kotlin-test-annotations-common'
}
}
}
Kris Wong
01/03/2020, 7:16 PMHannes
01/03/2020, 7:26 PMgradlew check
and it failed in compileTestKotlinJvm
I guess I miss the dependencies in
implementation 'org.jetbrains.kotlin:kotlin-test'
implementation 'org.jetbrains.kotlin:kotlin-test-junit'
commonTest
worksKris Wong
01/03/2020, 7:28 PMmain
dependencies as wellHannes
01/03/2020, 7:29 PMKris Wong
01/03/2020, 7:32 PMHannes
01/03/2020, 7:38 PMKris Wong
01/03/2020, 7:50 PM