Skip to content

Commit

Permalink
chore(drill): improve tests
Browse files Browse the repository at this point in the history
Signed-off-by: mateonunez <mateonunez95@gmail.com>
  • Loading branch information
mateonunez committed Mar 7, 2023
1 parent 4cf633d commit 2f785ea
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/drill/test/common.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ test('should drop a database', ({ end }) => {
await killDatabase(db)
})

const { db, queryer } = await setupDatabase(logger, supportedDatabase, getOptions(supportedDatabase))
const databaseName = 'test'
await queryer[privateMethods].createDatabase(databaseName, { dropIfExists: true })

const { db, queryer } = await setupDatabase(logger, supportedDatabase, getOptions(supportedDatabase))
await queryer[privateMethods].createDatabase('test', { dropIfExists: true })
await queryer[privateMethods].dropDatabase(databaseName)

equal(await queryer[privateMethods].databaseExists(databaseName), false)
Expand All @@ -54,10 +55,14 @@ test('should create a new table', ({ end }) => {
test(supportedDatabase, async ({ same, teardown }) => {
teardown(async () => {
await queryer[privateMethods].dropTable(tableName)
await queryer[privateMethods].dropDatabase('test')
await killDatabase(db)
})

const { db, queryer } = await setupDatabase(logger, supportedDatabase, getOptions(supportedDatabase))
const { db, queryer } = await setupDatabase(logger, supportedDatabase, {
...getOptions(supportedDatabase),
database: 'test'
})
await queryer[privateMethods].createDatabase('test', { dropIfExists: true })
const tableName = 'common_table_test'
await createTable(queryer, tableName)
const data = await queryer.selectData(tableName)
Expand Down

0 comments on commit 2f785ea

Please sign in to comment.