I'm writing a REST api backend in NODE js, which is based on MVC approach. My api routes directly hit the controllers, which in turn import models which are a wrapper around the methods from a library (DB ORM) called sequelize.
What will be the better approach for writing the unit tests for the controllers,
- To include models, with mock DB data, in unit tests of the respective controllers
- To somehow mock the models and then unit test my controllers without involving the real models at all.
If the second approach is better how will I achieve writing these types of Unit tests