Unit Test function that returns Mongoose promise Unit Test function that returns Mongoose promise mongoose mongoose

Unit Test function that returns Mongoose promise


It looks unlikely that you would have deliberately left out the res.send() call in your sample code for the sake of conciseness.

Just to make sure, are you returning a 200 status code when userCreate function called in the router succeeds?

userCreate(req).then(function() {   // success   res.status(200).send('User created successfully');}