Skip to content

Instantly share code, notes, and snippets.

@deskoh
Last active May 23, 2020 02:00
Show Gist options
  • Select an option

  • Save deskoh/003c4f62c5f37a2c6ebec021b41b9c15 to your computer and use it in GitHub Desktop.

Select an option

Save deskoh/003c4f62c5f37a2c6ebec021b41b9c15 to your computer and use it in GitHub Desktop.
VS Code Debug Recipes

Debugging Receipes for VS Code

{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Current Test",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"env": {
"TS_NODE_FILES": "true",
"NODE_ENV": "test"
},
"args": [
"-r",
"ts-node/register/transpile-only",
"--timeout",
"999999",
"--colors",
"--exit",
"**/${fileBasename}"
],
"console": "integratedTerminal"
}
]
}
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"env": {
"TS_NODE_FILES": "true",
"NODE_ENV": "test"
},
"args": [
"-r",
"ts-node/register/transpile-only",
"--timeout",
"999999",
"--colors",
"--exit",
"test/**/*.ts"
],
"console": "integratedTerminal"
}
]
}
{
"version": "0.2.0",
"configurations": [
{
"name": "TS-Node (Watch)",
"type": "node",
"request": "launch",
"protocol": "inspector",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/ts-node-dev",
"env": {
"TS_NODE_FILES": "true"
},
"args": [
"--inspect",
"--no-notify",
"--transpileOnly",
"--respawn",
"${workspaceFolder}/src"
],
"console": "integratedTerminal",
"restart": true
}
]
}
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "TS-Node",
"env": {
"NODE_ENV": "development",
"TS_NODE_FILES": "true"
},
"args": ["${workspaceFolder}\\src\\index.ts"],
"runtimeArgs": ["-r", "ts-node/register/transpile-only"],
"cwd": "${workspaceFolder}",
"internalConsoleOptions": "openOnSessionStart"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment