Skip to content
This repository was archived by the owner on Sep 14, 2018. It is now read-only.

Debugging

Hudson Thomas edited this page Apr 10, 2017 · 2 revisions

Debugging Electron apps is quite easy because we have the full access to the Chrome dev tools and the magical powers of the debugger trigger.

Debugging the app

To debug the main build of Golden, simply include the debugger trigger anywhere in your code. Then, immediately after launching Golden (yarn start) open the dev tools by pressing Ctrl+Shift+I.

When the execution reaches the debugger trigger, it will begin running in a step-by-step mode until the execution leaves the scope of the trigger.

A slightly more direct way to debug can also be console.log()ing the code you need. The console logs are printed out in the Dev tools console as well.

Debugging the tests

Sometimes you want to run your tests in a step-by-step mode to pinpoint a particular issue with them. Thankfully, Node.js allows us to use dev tools in the console as well.

To run the debugger in console, include the debugger trigger anywhere in the test.js file, then run:

mocha --inspect --debug-brk --require babel-register

This will run the tests in an inspect mode, which will provide you with a link to the Chrome dev tools.

Clone this wiki locally