NodeUnit Debugging

In my previous post, I talked about debugging Node.js applications. We use nodeunit to unit test our Node.js scripts and it’s useful to be able to debug those nodeunit tests as well.

So how do you do that? It’s quite simple. You follow the instructions in my previous post except instead of pointing the debugger to a Node.js script, you point to your nodeunit instance and then you point to your test.

For example, if nodeunit is installed under node_modules and your test is under test folder, here’s how you’d debug that using node-inspector:

node --debug-brk node_modules/nodeunit/bin/nodeunit test/myDummyTest.t.js
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s