Is there a way in node.js (ideally mocha too) to simulate the behavior of python
python -m pdb setup.py test
That will fallback to debug interface on if the program throws an uncaught exception.
EDIT
@robertklep suggested the undocumented breakOnException
command which looks really awesome but not so much in practice:
test.js
var hello = {};
function testFunc () {
anotherFunct();
}
function anotherFunct () {
var b = hello.unfound;
}
testFunc();
And then it freezes at:
$ node debug test.js
< Debugger listening on port 5858
connecting to port 5858... ok
break in test.js:1
> 1 var hello = {};
2 function testFunc () {
3 anotherFunct();
debug> breakOnException
debug> c
debug> backtrace
EDIT2: test.js didn't yield an error in the first place. The above works fine.