VS Code does not recognize junit tests

オープン
#1,692 コメント 37 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
静か
技術スタック
java, vscode

調査の方向性

報告された pom.xml の設定、src/test/java 配下のテスト、および preview-feature エラーを含む VS Code Java Test のログから始めてください。設定をリンクされている issue #470 と比較し、現在の診断についてコメントスレッドを確認してください。エラーが test lenses の欠落を説明するかどうかを特定し、再現可能な解決策を文書化できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

ai-triaged bug investigating junit maven test-discovery

I am following the steps at this page to run Junit5 tests with VS Code and Maven. I have these extensions installed:

image image image

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
image

and not sure if it is because of this.

related: https://github.com/Microsoft/vscode-java-test/issues/470

主要言語
TypeScript
スター
340
フォーク
173
平均マージ
1日 19時間
マージ済み PR(30日)
18

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/vscode-java-test のほかの issue

microsoft/vscode-java-test の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。