I am currently working on a project where the test files are stored in /code_tests
instead of the default /test
. I am trying to avoid having to rename the folder but I can't seem to change the default location for the Mocha Test Explorer.
The project is using Typescript on vscode.
The documentation provides this line of code. "mochaExplorer.files": "test/**/*.ts"
which I assume would need to be changed to "mochaExplorer.files": "code_tests/**/*.ts"
but I can't seem to find where to store this command for it to work as intended.
If the Test Explorer pane is not opened in your Visual Studio, you can access this as follows: in Visual Studio 2015 and 2017 - Test -> Windows -> Test Explorer; in Visual Studio 2019 and later - Test -> Test Explorer; or use keyboard shortcut Ctrl + E, T.
add these to vscode settings.json
"mochaExplorer.require": "ts-node/register",
"mochaExplorer.files": "code_tests/**/*.ts",
Well if you don't have .vscode
folder in you project structure, create one. And in .vscode/settings.json
add the following
"mochaExplorer.require": "ts-node/register",
"mochaExplorer.files": "tests/**/*.ts",
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With