Skip to content

Commit

Permalink
fix(drill): test should close db only once
Browse files Browse the repository at this point in the history
Signed-off-by: mateonunez <mateonunez95@gmail.com>
  • Loading branch information
mateonunez committed Nov 11, 2023
1 parent 31c4145 commit 7ef14b4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/drill/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ test('database', async (t) => {
const { db, queryer } = await setupDatabase(logger, database.name, database.options)
const tables = await resolveTables(logger, queryer, database.options)
ok(tables.length > 0)
await killDatabase(db)
})
}
})
Expand All @@ -67,7 +66,6 @@ test('database', async (t) => {
const { db, queryer } = await setupDatabase(logger, database.name, database.options)
const tables = await resolveTables(logger, queryer, { ...database.options, tableName: 'users' })
ok(tables.length === 1)
await killDatabase(db)
})
}
})
Expand All @@ -76,12 +74,15 @@ test('database', async (t) => {
const { ok } = tspl(t, { plan: 2 })

for (const database of supportedDatabases) {
await t.test(database.name, async () => {
await t.test(database.name, async (t) => {
t.after(async () => {
await killDatabase(db)
})

const { db, queryer } = await setupDatabase(logger, database.name, database.options)
const tables = await resolveTables(logger, queryer, database.options)
const data = await resolveData(logger, queryer, tables, database.options)
ok(data)
await killDatabase(db)
})
}
})
Expand Down

0 comments on commit 7ef14b4

Please sign in to comment.