Skip to content

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

@MaddyGuthridge

Description

@MaddyGuthridge

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions