Testing Node.js packages is easy. Here's the condensed 1-minute guide to setting up tests on a Node.js project.
package.json file if you don't have one yet, then install your weapons of choice.
Make your first test file
package.json to use mocha.
npm test to run your tests. It should fail. Now go write tests that will pass!
Here's a quick Mocha cheatsheet. Also see mochajs.org.
Here's a quick Chai cheatsheet. See chaijs.com for other
Use Sinon (sinonjs.org) for mocks.