mongoosejs / mongoose-lean-virtuals

Attach virtuals to the results of mongoose lean() queries
Apache License 2.0
45 stars 24 forks source link

RFC: Make tests more comprehensive #23

Closed stieg closed 5 years ago

stieg commented 5 years ago

Makes the tests more comprehensive by testing find, findById, findByIdAndUpdate, findOne, findOneAndUpdate independently instead of only testing findOne almost exclusively.

Also re-organizes the structure of the test to reduce the re-creation of schemas, models and docs and consolidates some of the code together to ensure consistent testing behavior is achieved.

NOTE: Had to skip the last test currently as it is broken. This is tracked by #22. Strange bit is that all of the tests fail, not just the find. I'm not sure what I did to break it but tests seem logical.