Sign in
Log inSign up
I want to test my ExpressJS controller code. How do I test the database calls?

I want to test my ExpressJS controller code. How do I test the database calls?

Lisa Stroupe's photo
Lisa Stroupe
·Jan 11, 2016

I am using MongoDB as database and mongoose as the ODM. I want to test my controller code but don't want to use the database for testing, how can I mock the database and database calls? How do you generally test your controller code.