Skip to content

Instantly share code, notes, and snippets.

@sixman9
Created August 5, 2020 11:59
Show Gist options
  • Save sixman9/d044938727a063f2527bbe6a5870c073 to your computer and use it in GitHub Desktop.
Save sixman9/d044938727a063f2527bbe6a5870c073 to your computer and use it in GitHub Desktop.
VSCode Mocha TypeScript debug launch configuration (place in '<project>/.vscode/launch.json')
{
"version": "0.2.0",
"configurations": [
{
"name": "Current TS File",
"type": "node",
"request": "launch",
"args": ["${file}"],
"runtimeArgs": ["--nolazy", "-r", "ts-node/register"],
"sourceMaps": true,
"cwd": "${workspaceRoot}",
"protocol": "inspector"
},
{
"type": "node",
"request": "launch",
"name": "Mocha Tests",
"program": "${workspaceRoot}/node_modules/.bin/_mocha",
"args": [
"--require",
"ts-node/register",
"-u",
"tdd",
"--timeout",
"999999",
"--colors",
"--recursive",
"${workspaceFolder}/**/*.spec.ts"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "Current TS Mocha File",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/node_modules/.bin/_mocha",
"args": ["-r", "ts-node/register", "${file}"],
"cwd": "${workspaceRoot}",
"protocol": "inspector"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment