I am trying to stub a mongoose model to return a json value
the code that i have is
var valueToReturn = {
name:'xxxxx'
};
var stub = sinon.stub(MyModel.prototype,'findOne');
stub.returns(valueToReturn);
I get this error : TypeError:Attempted to wrap undefined property findOne as function