DEV Community

Discussion on: Bypassing the database and testing to see if this solution works

Collapse
 
szymach profile image
Piotr Szymaszek

We have recently began relying on collection based repositories for functional tests (they store data/objects in memory, instead of saving it in the database). Unit tests should receive mock database connections and return mock data for database calls.

The idea is to split the testing environment into non persistent and persistent. This way you only test the database related bits when you know the code is working properly.

Collapse
 
chenge profile image
chenge

Yes, agree.