twolfson / karma-electron

Karma launcher and preprocessor for Electron
The Unlicense
59 stars 21 forks source link

running with ndb for debugging? #36

Closed trusktr closed 5 years ago

trusktr commented 5 years ago

I'm curious to know if there's a way to run karma with karma-electron with ndb so that I can step through code.

I've tried something like

./node_modules/.bin/ndb ./node_modules/.bin/karma start --single-run --browsers Electron ./config/karma.config.js

which opens the ndb devtools window, but nothing runs in there, there's no source files visible in there, nothing is paused, and karma simply runs everything. It's at least not pausing on karma code, though I imagine hooking into Electron might require some other steps.

Any idea how to inspect code running in karma-electron?

(I asked on SO, but no luck there after a month).

twolfson commented 5 years ago

ndb is designed for Node.js. While Karma's core is based in Node.js, it runs all the tests inside of its respective browsers so ndb doesn't make much sense. Instead, debugging can be performed via a browser's built-in tools

In the case of karma-electron, these are the Chrome Dev Tools built into Electron. I've covered this in detail here:

https://github.com/twolfson/karma-electron/issues/18

trusktr commented 5 years ago

Ah, thanks! It'd be neat if ndb would be able to pick up any Chrome process.