test: add teardown dependency to clean db after tests

This commit is contained in:
Jakub P.
2024-07-22 15:42:21 +02:00
parent 129327f40d
commit 37d02eba02
5 changed files with 50 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
const { publicTest } = require('../fixtures');
import knex from 'knex';
import knexConfig from '../knexfile.js';
publicTest.describe('restore db', () => {
publicTest('clean db and perform migrations', async () => {
const knexClient = knex(knexConfig)
const migrator = knexClient.migrate;
await migrator.rollback({}, true);
await migrator.latest();
})
});