Skip to content

JUnit 5 error message on project that uses JUnit 6 #1837

Description

When I attempt to use VS Code to run my project's test suite, I get the following error:

Cannot find org.junit.platform.commons.annotation.Testable on project build path. JUnit 5 tests can only be run if JUnit 5 is on the build path.

This is very unusual, given that the project uses JUnit 6, as per the build.gradle:

dependencies {
    // Use JUnit Jupiter for testing.
    testImplementation 'org.junit.jupiter:junit-jupiter:6.0.1'
    //                                                  ^^^^^
    testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

I have confirmed that tests run correctly when using gradle test.

I am currently making a minimal reproduction repo, which I will link here as soon as it is completed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions