Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not support fluent schema queries #8

Open
dnlsngr opened this issue Mar 24, 2015 · 3 comments
Open

Does not support fluent schema queries #8

dnlsngr opened this issue Mar 24, 2015 · 3 comments

Comments

@dnlsngr
Copy link

dnlsngr commented Mar 24, 2015

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);

@robhawkes
Copy link

This would be really useful for my use-case too

@hpgmiskin
Copy link

Hello I found sinon-mongoose which seems to let you test chained mongoose queries if that helps

@blugavere
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants