3 ms·
It is not hard to isolate and stub a database the problem is you will not catch a lot of errors, e.g. writing a 40 char string into a VCHAR(10), DateTime conver
by WolfOliver 5y ago
It is not hard to isolate and stub a database the problem is you will not catch a lot of errors, e.g. writing a 40 char string into a VCHAR(10), DateTime conversations, ...
In Ruby on Rails it is quite common to use a real database in the unit tests. Even before containers came out and it is still fast (yes, less than 1 second).
In rails you use the same database instance for all the tests, so you do not have spin up a database instance for every case. Instead you use a database cleaner.
There also exists a JS implementation: https://github.com/khaiql/dbcleaner https://github.com/khaiql/dbcleaner