I am writing some unit tests for node.js code and I use Sinon to stub function calls via
var myFunction = sinon.stub(nodeModule, \'myFunction\'); myFunction.
You can refactor your module a little. Like this.
var service = { myFunction: myFunction, anotherFunction: anotherFunction } module.expors = service; function myFunction(){}; function anotherFunction() { service.myFunction(); //calls whatever there is right now }