add attach debug configuration
- Attach debug configuration - Scripts: debug, serve-debug, watch-debug - Readme
This commit is contained in:
Родитель
26706d08d5
Коммит
f8141a0b06
|
@ -4,6 +4,12 @@
|
|||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "attach",
|
||||
"name": "Attach",
|
||||
"port": 9229
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
|
|
|
@ -299,6 +299,11 @@ Now just set your breakpoints and go!
|
|||
VS Code will try to launch on the same port and error out.
|
||||
Likewise be sure to stop the debugger before returning to your normal `npm start` process.
|
||||
|
||||
#### Using attach debug configuration
|
||||
VS Code debuggers also support attaching to an already running program. The `Attach` configuration has already configured, everything you need to do is change `Debug Configuration` to `Attach` and hit `F5`.
|
||||
|
||||
> Tip! Instead of running `npm start`, using `npm run debug` and `Attach Configuration` that make you don't need to stop running project.
|
||||
|
||||
## Testing
|
||||
For this project, I chose [Jest](https://facebook.github.io/jest/) as our test framework.
|
||||
While Mocha is probably more common, Mocha seems to be looking for a new maintainer and setting up TypeScript testing in Jest is wicked simple.
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
"name": "express-typescript-starter",
|
||||
"version": "0.1.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@types/async": {
|
||||
"version": "2.0.40",
|
||||
|
|
|
@ -19,7 +19,10 @@
|
|||
"build-sass": "node-sass src/public/css/main.scss dist/public/css/main.css",
|
||||
"watch-sass": "node-sass -w src/public/css/main.scss dist/public/css/main.css",
|
||||
"tslint": "tslint -c tslint.json -p tsconfig.json",
|
||||
"copy-static-assets": "node copyStaticAssets.js"
|
||||
"copy-static-assets": "node copyStaticAssets.js",
|
||||
"debug": "npm run build && npm run watch-debug",
|
||||
"serve-debug": "nodemon --inspect dist/server.js",
|
||||
"watch-debug": "concurrently -k -p \"[{name}]\" -n \"Sass,TypeScript,Node\" -c \"yellow.bold,cyan.bold,green.bold\" \"npm run watch-sass\" \"npm run watch-ts\" \"npm run serve-debug\""
|
||||
},
|
||||
"jest": {
|
||||
"globals": {
|
||||
|
@ -93,4 +96,4 @@
|
|||
"tslint": "^5.0.0",
|
||||
"typescript": "^2.4.0"
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче