Reputation: 149
What is the best way to handle records in the database after end-to-end tests have passed? Should we change affected records deleted_at
column to the current date or remove these records at all since new tests will create more new records all the time?
The system will ignore those records with deleted_at
flag but at the same time every new test will add new records and it will be equal for trashing database.
What is the best practice to use?
Upvotes: 0
Views: 722
Reputation: 729
We usually start a docker container with a clean database or an initial setup every time we run the tests. You can also clean the database in a beforeAll() function. There is no need to persist the records created by the tests since you can add them again
Upvotes: 1