How to run migration before test, and reset it after test?

I know it should be in the hooks, but I don’t know how to call migration commmand inside it.

1 Like

You can define it on vowfile, see this example

1 Like

This wasn’t the answer for us. We needed to reset the db after each test. Transaction rollbacks to the rescue, but we’ve had to add it to each suite’s beforeEach and afterEach. :frowning:

1 Like

A bit late, but you can do as in the following answer: Add traits to all test files globally? . Same way you can use suite.trait you can use suite.beforeEach, suite.afterEach, etc.

1 Like

Thanks for the tip