MrGrygson
MrGrygson
DTDrizzle Team
Created by baronnoraz on 12/29/2023 in #help
Unit Testing with Transactions
Or you can also use mysql-test package, so your test code is clean (it also runs mysql server in docker). You just need to use different env values to connect to test db and run migration to create tables. https://www.atdatabases.org/docs/mysql-test
12 replies
DTDrizzle Team
Created by baronnoraz on 12/29/2023 in #help
Unit Testing with Transactions
Do unit tests as they should be, so mock any external calls from tested function (including calls for DB) For integration test and running it against DB, I'm just starting with fresh DB every time I launch the test, and try to have unique context in each test, so there is no need for rollback.
12 replies