"No Tests have been found in this workspace yet" - Unable to run jUnit

Maggie olanubi 0 Reputation points
2025-04-02T19:20:06.13+00:00

Hello! I'm having trouble running jUnit tests. The "Enable Junit Tests" button does not show up for me, however it was working previously to this day.

I have some super simple code for an example:

public class Greet {
    public String says(){
        return "Hello";
    }
    
}

Test:

import org.junit.*;


public class GreetTest {

    @Test
    public void test(){
        Greet gre = new Greet();
        Assert.assertEquals("Hello", gre.says());
        
    }
}


I have the Microsoft Test Runner installed, and the other extension in the pack as well: Screenshot 2025-04-02 151737

However no matter what I do, I have uninstalled and reinstalled the extension, VSC and my JDK. However this is all im seeing in regards to the Testing User's image

Has anyone ever experienced this and know how to fix it?

Thank you,

Maggie

Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
367 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 34,311 Reputation points Microsoft External Staff
    2025-04-03T07:11:57.1166667+00:00

    Hi Maggie,

    I doubt that there is something wrong with the extension(Test Runner for Java) or VS Code.

    I also remember that this worked, but when I tried to install a new VS Code, configure JDK, and check VS Code, the "Enable Java Tests" option is not available.

    Do you still remember what have changed, as you mentioned that "it was working previously to this day". Is something updated automatically maybe during this short time?

    I see some other developers also get the same issue, I would strongly recommend you submit a ticket on GitHub - vscode-java-test.

    If you do submit a ticket, please kindly share the ticket link here for better tracking.

    Best regards,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.