Skip to content

KotlinTest NoClassDefFoundError #492

@davidsowerby

Description

@davidsowerby

Attempting to run tests with KotlinTest causes the error below. I think it is simply because the Kobalt KotlinTestRunner is based on JUnit4. KotlinTest uses JUnit5, from version 3.0.0 I believe, which would have been after you added KotlinTest support at #312

───── kayman-design:compile
───── kayman-design:compileTest
───── kayman-design:test
Running tests with JUnit 4


***** ERROR Error: java.lang.NoClassDefFoundError: io/kotlintest/specs/BehaviorSpec

import com.beust.kobalt.project
import com.beust.kobalt.test

val p = project {
    name = "kayman-design"
    group = "com.example"
    artifactId = name
    version = "0.1"

    dependencies {
        compile("org.jetbrains.kotlin:kotlin-runtime:1.2.61")
        compile("org.jetbrains.kotlin:kotlin-stdlib:1.2.61")
    }

    dependenciesTest {
        compile("io.mockk:mockk:1.8.6")
        compile("io.kotlintest:kotlintest-runner-junit5:3.1.10")
    }
    
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions