Prepopulate test suites with data

In our tests, we do a lot of set up at each test Suite on the before hook, and manually delete each item inserted in the after hook. Is there a simpler way of prepopulating the database at each distinct test suite? (perhaps a seed that run on each suite, no on each test?)

You could run seeds on vowfile.js after running your migrations. Something like this:

await'seed', {}, { files: 'seed_file_1.js, seed_file_1.js' })

I think this works in “beforeEach” inside your tests suite.

Lifecyle Hooks
before: // executed before all the tests for a given suite
beforeEach: // executed before each test inside a given suite

1 Like

No way of having a bunch of tests run on the same seed, then, right? that’s more what i’d been shooting for. But now that i think about it I might, doing it for each individual test works too.