microsoft / microsoft/vscode-java-test
VS Code does not recognize junit tests
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 340
- Forks
- 173
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 18
Description
I am following the steps at this page to run Junit5 tests with VS Code and Maven. I have these extensions installed:
and my pom.xml has:
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<scope>test</scope>
</dependency>
I have put my test classes in src/test/java. but VS Code does not detect JUNIT5 tests. the green "lenses" or "buttons" do not show up next to the tests. In one of the logs I could see:
Preview features enabled at an invalid source release level 21, preview can be enabled only at source level 22; code: 2098258
and not sure if it is because of this.
related: https://github.com/Microsoft/vscode-java-test/issues/470
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported pom.xml configuration, the tests under src/test/java, and the VS Code Java Test logs containing the preview-feature error. Compare the setup with the linked issue #470 and review the comment thread for the current diagnosis. Done means identifying whether the error explains the missing test lenses and documenting a reproducible resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, vscode
- Domain
- developer-experience, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100