-
Notifications
You must be signed in to change notification settings - Fork 4
Debugging
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.
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.
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.