I would like to stub the save
method available to Mongoose models. Here\'s a sample model:
/* model.js */
var mongoose = require(\'mongoose\');
Have you tried:
sinon.stub(userModel.prototype, 'save')
Also, where is the helper function getting called in the test? It looks like you define the function as the utils module, but call it as a method of a controller object. I'm assuming this has nothing to do with that error message, but it did make it harder to figure out when and where the stub was getting called.