Database transactions when testing


#1

I have my tests configured to run my migrations prior and reset after running my tests but I really need to use transactions else a way to reset the database after each individual test.

Can anybody advise?


#2

Ignore me, I just deleted records using a query()


#3

There is a Database testing trait that does this. See the docs in the testing section.

https://adonisjs.com/docs/4.0/testing-fakes#_database_transactions


#4

@moltar thankyou!