Skip to content

Commit

Permalink
refactor: fix database test
Browse files Browse the repository at this point in the history
Signed-off-by: Jeroen Branje <[email protected]>
  • Loading branch information
jeroenbranje committed Jan 16, 2024
1 parent 0be8149 commit 58c7e3e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/envited.ascs.digital/common/database/database.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { initDb } from './database'
import * as schema from './schema'

describe('common/database', () => {
describe('database', () => {
Expand Down Expand Up @@ -26,7 +27,7 @@ describe('common/database', () => {
const db = await initDb({ drizzle, postgres, getSecret })()

expect(postgres).toHaveBeenCalledWith(config)
expect(drizzle).toHaveBeenCalledWith(postgres(config))
expect(drizzle).toHaveBeenCalledWith(postgres(config), { schema })
expect(getSecret).not.toHaveBeenCalled()
expect(db).toEqual('DB_CONNECTION')
})
Expand Down Expand Up @@ -59,7 +60,7 @@ describe('common/database', () => {
const db = await initDb({ drizzle, postgres, getSecret })()

expect(postgres).toHaveBeenCalledWith(config)
expect(drizzle).toHaveBeenCalledWith(postgres(config))
expect(drizzle).toHaveBeenCalledWith(postgres(config), { schema })
expect(getSecret).toHaveBeenCalled()
expect(db).toEqual('DB_CONNECTION')
})
Expand Down

0 comments on commit 58c7e3e

Please sign in to comment.