Reputation: 5893
What I am looking for is basically nosetest --pdb --pdb-failures
from nose testing framework.
I am using mocha for testing. What I'd like to do is to run tests like
mocha --break-on-exception --break-on-failure
that would stop executing tests once encountering exception or assertion failure, would start node-inspector for me and would allow me to introspect runninng code.
Is this possible anywhere in node.js world, with any library or test framework?
Upvotes: 5
Views: 1184
Reputation: 25446
add this line to your test:
if (global.v8debug)
global.v8debug.Debug.setBreakOnException()
start with mocha --debug-brk
, connect node-inspector, continue and wait for exception
Upvotes: 5