How can I configure Mocha sidebar for my project?
My test files are located in this path: /src/Gamma.Tests/*.ts.
Also I set these in settings.json file:
"mocha.files.glob": "src/Gamma.Tests/**/*.ts",
"mocha.requires": [
"ts-node/register"
]
I have installed these packages already:
npm install typescript --save-dev
npm install ts-node --save-dev
npm install -g ts-node
npm install -g typescript
The error in VSCode:
Failed to run Mocha due to error message:
" Cannot find module 'ts-node/register' Require stack:
- c:\Users\rouhi.vscode\extensions\maty.vscode-mocha-sidebar-0.22.2\lib\worker\findtests.js " error trace can be found in the ouput channel . for more help:
How can I solve this problem?
Notice:
in package.json file:
"scripts": {
"test": "mocha -r ts-node/register src/Gamma.Tests/**/*.ts",
"start": "tsc && node ./build/server.js"
},
There is no problem, when I run npm run test
