Debug
Breakpoints
Development
- Launch the server using the build task
start debug server
launch task - Update the following settings of Dendron to use a running server through the following workspace setting
dev:
dendron.serverPort": 3005`
- Reload the workspace for the settings to take affect
Testing
Tests that use the engine server connect to a dynamically created express server when making api calls. These calls can be hard to debug. If you want to step through the server side code, pass in createEngineByConnectingToDebugServer
to the tests instead while testing
createEngineByConnectingToDebugServer
await runEngineTestV5(
async () => {
...
},
{
- createEngine: createEngineFromServer,
+ createEngine: createEngineByConnectingToDebugServer,
}
);
Afterwards, follow instructions from Debug to launch the debug server.
Debugging api-server in another IDE
- Start the api-server with debug port open:
This starts api-server with port 9229 open.cd $DENDRON_REPO_ROOT/packages/api-server npm run start:integ:debug
- Attach to api-server from your IDE. Example settings for InteliJ/WebStorm:
Run/Debug Configuration:
Attach to Node.js/Chrome:
Host: localhost
Port: 9229
Attach To: Chrome or Node.js > 6.3 started with --inspect
Backlinks