DEV Community

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

Collapse
 
brianle10680751 profile image
Brian Le

Hi, Great article, I have tried your configuration, and it works in some case.
However, if I use my customvalidate function in my schema , it not works. Is there any way to let the 'mongodb-memory-server' understand what we define in Schema - Model

Collapse
 
paulasantamaria profile image
Paula Santamaría

I haven't had any issues with mongoose validations in this setup. 'mongodb-memory-server' shouldn't prevent mongoose validations from working.
Would you please provide an example of the code that has the issue?