英文:
vscode - java test runner : exclude directory from tests
问题
从 Java 测试运行器的测试资源管理器中排除文件夹?
我正在使用 VS Code 编写 Java 的集成测试。我非常喜欢 Java 测试运行器插件。目前唯一的问题是测试资源管理器会包含我 src\test\java\com\testapp\Shared
文件夹中那些没有任何测试的 .java 文件。有没有办法从测试资源管理器中排除这个文件夹?虽然在资源管理器中看到它们不会影响任何事情,但我的强迫症让我很烦恼。
我尝试过的方法
在我的 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.
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.
"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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论