I do not know how to start a replica in the process of karma, but you can simply write:
debugger;
at the point where you want to debug. Then, if you already have the dev developer tools, when this line is executed, execution is paused and you can use the "expressions for viewing", which may be enough for you. You have access to the call stack and all local variables. You can also assign local variables in a clock expression, and new values ββare saved when execution resumes.
I tested this only in Chrome. I have to do it:
- Place the
debugger; statement debugger; in. - The beginning of karma.
- Open Chrome dev tools.
- Save one of the viewed karma files (so now the tests will run again with the tools already open).
- Profit!
Performing REPL on the karma side will require much more effort, since all the test code is executed in the browser. To control REPL from the karma process, you need to configure events for communication through sockets, which karma sets up to talk to the browser. Must be doable, though if you are so addicted. EDIT:, for this you will still need to execute the Javascript block in a specific expression, and Iβm that debugger; is the only way to do this.
source share