I'm migrating a program to Kotlin 1.6, and from bu...
# test
v
I'm migrating a program to Kotlin 1.6, and from build.gradle to build.gradle.kts. I'm using
spek
and
mocck
for testing. I'm getting a gradle error and wondered if someone could help me understand what it means?
Copy code
Execution failed for task ':compileTestKotlin'.
> Could not resolve all files for configuration ':testCompileClasspath'.
   > Could not resolve org.jetbrains.kotlin:kotlin-test-junit5:1.6.21.
     Required by:
         project :
      > Module 'org.jetbrains.kotlin:kotlin-test-junit5' has been rejected:
           Cannot select module with conflict on capability 'org.jetbrains.kotlin:kotlin-test-framework-impl:1.6.21' also provided by [org.jetbrains.kotlin:kotlin-test-junit:1.6.21(junitApi)]
   > Could not resolve org.jetbrains.kotlin:kotlin-test-junit:1.6.21.
     Required by:
         project : > io.insert-koin:koin-test:3.2.0 > io.insert-koin:koin-test-jvm:3.2.0
      > Module 'org.jetbrains.kotlin:kotlin-test-junit' has been rejected:
           Cannot select module with conflict on capability 'org.jetbrains.kotlin:kotlin-test-framework-impl:1.6.21' also provided by [org.jetbrains.kotlin:kotlin-test-junit5:1.6.21(junit5Api)]
From my build.gradle.kts file, I have the following test configuration:
Copy code
dependencies {
// ...
// testing
	testImplementation("io.insert-koin:koin-test:$koin_version")
//	testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlin_version")
	testImplementation("org.jetbrains.kotlin:kotlin-test-junit5:$kotlin_version")
	testImplementation("org.spekframework.spek2:spek-dsl-jvm:$spek_version")
	testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:$spek_version")
	testImplementation("io.mockk:mockk:$mockk_version")
}

tasks.test {
	useJUnitPlatform {
		includeEngines("spek2")
	}
}

tasks.withType<KotlinCompile> {
	kotlinOptions.jvmTarget = "11"
}
Just trying to make sense of the error really.
Removing all the
kotlin-test
dependencies seems to have made it compile. I won't be using spek in future projects though.