vscode – Java测试运行器:排除测试目录

huangapple go评论82阅读模式
英文:

vscode - java test runner : exclude directory from tests

问题

从 Java 测试运行器的测试资源管理器中排除文件夹?

我正在使用 VS Code 编写 Java 的集成测试。我非常喜欢 Java 测试运行器插件。目前唯一的问题是测试资源管理器会包含我 src\test\java\com\testapp\Shared 文件夹中那些没有任何测试的 .java 文件。有没有办法从测试资源管理器中排除这个文件夹?虽然在资源管理器中看到它们不会影响任何事情,但我的强迫症让我很烦恼。

vscode – Java测试运行器:排除测试目录

Java 用于 VS Code 的测试运行器

我尝试过的方法

在我的 settings.json 文件中,我尝试只指定 Services 文件夹用于测试。但这并没有筛选测试资源管理器中的内容。:(

"java.test.config": [
    {
        "name": "unit",
        "workingDirectory": "${workspaceFolder}/src/test/java/com/testapp/Services",
    },
],
英文:

Exclude folder from from Java Test Runner's - Test Explorer?

I'm writing integration tests in java using vscode. I am really enjoying the java test runner plugin. The only downside right now is that the test explorer is including .java files in my src\test\java\com\testapp\Shared folder that have 0 tests in them. Is there a way to exclude this folder from the test explorer? Seeing them in the explorer doesn't affect anything but OCD is kicking my butt.

vscode – Java测试运行器:排除测试目录

Java Test runner for vscode

Things I've tried

in my settings.json, i tried to point to ONLY use the Services folder for testing. Didn't filter the test explorer. vscode – Java测试运行器:排除测试目录

"java.test.config": [
        {
            "name": "unit",
            "workingDirectory": "${workspaceFolder}/src/test/java/com/testapp/Services",
        },
    ],

答案1

得分: 1

目前(v0.25.0)该扩展将显示测试源路径中的所有类型。关于此问题有一个跟踪问题:https://github.com/microsoft/vscode-java-test/issues/768

// 抱歉,我的声望小于50,因此我无法直接对您的问题发表评论。

英文:

Currently(v0.25.0) the extension will show all the types in the test source paths. There is a tracking issue about this problem: https://github.com/microsoft/vscode-java-test/issues/768

// Sorry my reputation is < 50, so I cannot directly comment on your question.

huangapple
  • 本文由 发表于 2020年10月23日 18:31:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/64498357.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定