Sharing Top Content from the Angular-sphere.

Debugging TypeScript from VSCode – Spektrakel Blog – Medium

  • ts file from VSCode, attach the debugger.TL;DR: that’s what it looks likeVSCode launch.json configHere’s how to do it:{ “version”: “0.2.0”, “configurations”: [ { “type”: “node”, “request”: “launch”, “name”: “Launch current file w/ ts-node”, “protocol”: “inspector”, “args”: [“${relativeFile}”], “cwd”: “${workspaceRoot}”, “runtimeArgs”: [“-r”, “ts-node/register”], “internalConsoleOptions”: “openOnSessionStart” } ]}Debugging a single mocha testThe same…
  • ts file (the one currently being open in the editor), with mocha and ts-node:{ “version”: “0.2.0”, “configurations”: [ { “type”: “node”, “request”: “launch”, “name”: “Launch current file w/ mocha”, “program”: “env”: { “TS_NODE_PROJECT”: “src/tsconfig.
  • specs.json” }, “args”: [ “–ui”, “tdd”, “–timeout”, “4000”, “–colors”, “–require”, “ts-node/register”, “${relativeFile}” ], “cwd”: “${workspaceRoot}”, “internalConsoleOptions”: “openOnSessionStart” } ]}AttributionsBig shout out to Russell Briggs for discovering this!

Launch a .ts file from VSCode, attach the debugger. “Debugging TypeScript from VSCode” is published by David Herges in Spektrakel Blog

Debugging TypeScript from VSCodeLaunch a .ts file from VSCode, attach the debugger.TL;DR: that’s what it looks likeVSCode launch.json configHere’s how to do it:{ “version”: “0.2.0”, “configurations”: [ { “type”: “node”, “request”: “launch”, “name”: “Launch current file w/ ts-node”, “protocol”: “inspector”, “args”: [“${relativeFile}”], “cwd”: “${workspaceRoot}”, “runtimeArgs”: [“-r”, “ts-node/register”], “internalConsoleOptions”: “openOnSessionStart” } ]}Debugging a single mocha testThe same approach, launching an individual .ts file (the one currently being open in the editor), with mocha and ts-node:{ “version”: “0.2.0”, “configurations”: [ { “type”: “node”, “request”: “launch”, “name”: “Launch current file w/ mocha”, “program”: “env”: { “TS_NODE_PROJECT”: “src/tsconfig.specs.json” }, “args”: [ “–ui”, “tdd”, “–timeout”, “4000”, “–colors”, “–require”, “ts-node/register”, “${relativeFile}” ], “cwd”: “${workspaceRoot}”, “internalConsoleOptions”: “openOnSessionStart” } ]}AttributionsBig shout out to Russell Briggs for discovering this!

Debugging TypeScript from VSCode – Spektrakel Blog – Medium

Comments are closed, but trackbacks and pingbacks are open.