If the npm run setup works as expected, the seeding and the db cleanup works correctly.
To test this fix fully, we'd need to add some data to the database with FK constraints, not have ON DELETE CASCADE on it, and expect cleanupDb to succeed.
Also, another good test would be to monkey patch the cleanupDb to throw inside the transaction and expect foreign_keys to be still on (catch clause reached)
PR to address https://github.com/epicweb-dev/epic-stack/issues/791
Test Plan
If the
npm run setup
works as expected, the seeding and the db cleanup works correctly.To test this fix fully, we'd need to add some data to the database with FK constraints, not have
ON DELETE CASCADE
on it, and expectcleanupDb
to succeed.Also, another good test would be to monkey patch the
cleanupDb
to throw inside the transaction and expectforeign_keys
to be still on (catch clause reached)Checklist
Screenshots