diff --git a/packages/falcon/test/index.test.js b/packages/falcon/test/index.test.js index 450b0840..de2e4812 100644 --- a/packages/falcon/test/index.test.js +++ b/packages/falcon/test/index.test.js @@ -5,10 +5,14 @@ import { database } from '@mateonunez/asterism-huston' const { mysqlOptions, postgresOptions } = database -t.before(async () => { +t.beforeEach(async () => { await seeder(undefined, 'mysql', { ...mysqlOptions, outputDir: './lyra' }) }) +t.afterEach(async () => { + await dropSeed(undefined, 'mysql', { ...mysqlOptions, outputDir: './lyra' }) +}) + t.test('no database selected should default to mysql', async ({ ok }) => { const { db } = await falconMigrate(undefined, { ...mysqlOptions, outputDir: './lyra' }) ok(db.isMysql) @@ -30,7 +34,3 @@ t.test('falcon search should return results', async ({ ok }) => { const results = await falconSearch('John', { inputDir: './lyra' }) ok(results) }) - -t.on('end', async () => { - await dropSeed(undefined, 'mysql', { ...mysqlOptions, outputDir: './lyra' }) -})