Finally!!! After a long search and reading some tutorials and comments I found the solution: the problem was with the config.
Open the test config file and delete the following lines:
"-u", <<<< delete this line
"tdd", <<<< delete this line
launch.js
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Mocha Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--require",
"ts-node/register",
"-u", <<<< delete this line
"tdd", <<<< delete this line
"--timeout",
"999999",
"--colors",
"${workspaceFolder}/tests/**/*.spec.ts"
],
"internalConsoleOptions": "openOnSessionStart"
},
Run the test again and it will work.