dimanche 28 décembre 2014

Jasmine spyOn mongoose save


I'd like to mock the save() function of a Mongoose model. I've tried:



spyOn(User, 'save').andReturn(null)


but that gives me the error:



save() method does not exist


Also, if I mock this function in the User model, the will an instance of the User model also have this function mocked?





Aucun commentaire:

Enregistrer un commentaire