Reputation: 19193
I have written some test cases and executing them using mocha. I am using sublime as the editor. When I run the test cases (using mocha), I want to add debugging points and want to see what is happening. If not SubLime, is there any way to execute these test case on browser and add breakpoints in browser?
If this approach is not practical what other alternatives I have?
Thank You
Upvotes: 2
Views: 1028
Reputation: 14881
You can use node-debug:
npm install -g node-inspector
Then:
node-debug _mocha test.js
It will open Chrome with the Web Inspector, ready to debug your app.
One problem you'll have is that, as the test isn't started yet, your files won't be loaded. You can add debugger;
statements in your code to force breakpoints.
Upvotes: 3