I'm trying to debug a set of Test for my javascript application using VSCode Debbugger, here is my configuration:
{ "args": [ "-u", "tdd", "--timeout", "999999", "--colors", "${workspaceFolder}/test" ], "internalConsoleOptions": "openOnSessionStart", "name": "Mocha Tests", "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", "request": "launch", "skipFiles": [ "<node_internals>/**" ], "type": "node" }
Which is the default one provided by Visual Studio for mocha tests, unfortunately when I run the configuration I get:
Uncaught Error Error: Cannot find module 'PROJECT_PATH/node_modules/mocha/bin/_mocha' at Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Module._load (node:internal/modules/cjs/loader:778:27) at executeUserEntryPoint (node:internal/modules/run_main:77:12) at <anonymous> (node:internal/main/run_main_module:17:47)
I double checked and the folder indeed do exists and mocha is installed both globally and inside the project, as I type:
mocha --version
I correctly get : 10.0, Any hints?
System config:
macOS Big Sur
Intel i7
VsCode 1.68.0
Node v16.14.0
Mocha v10.0