How can I test database queries without creating mocks

I am using ORM like Sequelize to interact with the database but I want to test the queries as unit test how can I do that without creating any fake models or instant methods like using sequelize mock.



answered 6 months ago Jocke #1

If you don't want to mock then don't do it!

Use unit tests to test your database with the real queries - you will most likely need some "setup" and "teardown" scripts/help methods.

If you are new to unit testing, start here:

comments powered by Disqus