mongoose-mock
mongoose-mock copied to clipboard
newing a mongoose model object sems to throw an error
get a TypeError: object is not a function when trying to new a mongoose object.
Using the readme example, if you change it from User.createAndSave to new User({title:'Mr'}) it will throw a not a function error
I had the same issue. I think this is a massive bug. Basically the creator of mongoose-mock appears to have confused the notions of Schema and Model. If I had more time, I might fix it with a pull-request, but I'm working on something that needs to be finished today, so I've switched to mockgoose instead.