This is actual for following versions:
node 10.16.0
mocha 6.1.4
typescript 3.5.3
vscode 1.36.1
Following configuration allows to run all the mocha typescript tests or the current open test file.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "[TEST] all",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--require", "tsconfig-paths/register",
"--require", "ts-node/register",
"./src/**/*.spec.ts",
"--timeout", "999999",
"--colors"
],
},
{
"type": "node",
"request": "launch",
"name": "[TEST] current",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--require", "tsconfig-paths/register",
"--require", "ts-node/register",
"${relativeFile}",
"--timeout", "999999",
"--colors"
],
},
]
}