繁体   English   中英

不在默认的“/test”文件夹中时使用带有 VScode 的 Mocha 测试资源管理器

[英]Using Mocha Test Explorer with VScode when not in default `/test' folder

我目前正在开发一个项目,其中测试文件存储在/code_tests而不是默认的/test中。 我试图避免重命名文件夹,但我似乎无法更改 Mocha 测试资源管理器的默认位置。

该项目在vscode上使用Typescript。

文档提供了这行代码。 "mochaExplorer.files": "test/**/*.ts"我认为需要更改为"mochaExplorer.files": "code_tests/**/*.ts"但我似乎找不到在哪里存储此命令以使其按预期工作。

把组合:

"mochaExplorer.require": "ts-node/register",
"mochaExplorer.files": "code_tests/**/*.ts",

进入vscode settings.json 。json

好吧,如果您的项目结构中没有.vscode文件夹,请创建一个。 并在.vscode/settings.json添加以下内容

"mochaExplorer.require": "ts-node/register",
"mochaExplorer.files": "tests/**/*.ts",

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM