3 ms·
> Unit tests should be small, specific enough tests that they should not ever require using the database. What if the code you're testing is an ORM, or somethi
by cabalamat 5y ago
> Unit tests should be small, specific enough tests that they should not ever require using the database.
What if the code you're testing is an ORM, or something else that intrinsically implies a database?
It seems to me that tests that're good enough that they'll catch a decent proportion of errors would involve a database here.
Of course, you might designate such tests "integration tests" rather than "unit tests", but I think the important thing about tests is not what you call them, it's whether they catch bugs.
- robertlagrant 5y agoWhat you call them is also important. Otherwise people won't know what you're talking about. You might say "it's better to do integration tests with SQLite than unit tests", but that's a different question.
- cabalamat 5y ago> Otherwise people won't know what you're talking about. That's a good point!