Open dnlsngr opened 9 years ago
This would be really useful for my use-case too
Hello I found sinon-mongoose which seems to let you test chained mongoose queries if that helps
the methods are missing, (like, lean), etc - but for chaining you can Model.find.returns(Model) within the test case, leveraging the sinon stub api to achieve what you're looking for
http://isaac.su/2014/05/mocking-fluent-objects-in-javascript/
Looking for a tool that will give me a drop-in mock for a schema-based query using fluent syntax. This tool lacks the recursive aspect necessary for that.
e.g. schema.find().where('name').equals('John').exec(callback);