File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/main/kotlin/io/kotest/plugin/intellij/run Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package io.kotest.plugin.intellij.run
22
33import com.intellij.openapi.module.Module
44import io.kotest.plugin.intellij.Test
5+ import io.kotest.plugin.intellij.gradle.GradleUtils
56import org.jetbrains.kotlin.psi.KtClassOrObject
67
78/* *
@@ -24,10 +25,14 @@ data class GradleTaskNamesBuilder(
2425 return copy(test = test)
2526 }
2627
28+ @Suppress(" UnstableApiUsage" )
2729 fun build (): List <String > {
2830 // the debug settings do not propagate from kotest to the other test tasks yet,
2931 // so if we think we're in a jvm test we can just invoke jvmKotest directly, and then debug will work
30- val task = if (module.name.endsWith(" .test" )) " jvmKotest" else " kotest"
32+ val task = if (module.name.endsWith(" .test" )) {
33+ val tasks = GradleUtils .listTasks(module).map { it.getFqnTaskName() }
34+ if (tasks.any { it.endsWith(" :jvmKotest" ) }) " jvmKotest" else " kotest"
35+ } else " kotest"
3136 return listOfNotNull(task, includeArg())
3237 }
3338
You can’t perform that action at this time.
0 commit comments