DEV Community

Discussion on: Testing Node.js + Mongoose with an in-memory database

Collapse
 
jimlynchcodes profile image
Jim Lynch

Nice article Paula!

I kind of feel like there could be more assertions in your final it block though than just, "expect ... to not throw".

To me it would be great if there was some was to look inside the mongo memory lib and say something like, "expect the fake mongoDb's collection to now have that additional document that I inserted".

Collapse
 
paulasantamaria profile image
Paula SantamarĂ­a

Thanks!
I completely agree. I actually added an extra test to check if the product exists after creating it on the repo, but didn't include it here because I wanted to keep the examples for the article simple.