Fix tests
This commit is contained in:
parent
8b6f0fd53d
commit
74055dc882
2 changed files with 12 additions and 7 deletions
|
@ -77,13 +77,15 @@ const sequelizeTypescript = new SequelizeTypescript({
|
|||
}
|
||||
})
|
||||
|
||||
sequelizeTypescript.authenticate()
|
||||
.then(() => logger.debug('Connection to PostgreSQL has been established successfully.'))
|
||||
.catch(err => {
|
||||
function checkDatabaseConnectionOrDie () {
|
||||
sequelizeTypescript.authenticate()
|
||||
.then(() => logger.debug('Connection to PostgreSQL has been established successfully.'))
|
||||
.catch(err => {
|
||||
|
||||
logger.error('Unable to connect to PostgreSQL database.', { err })
|
||||
process.exit(-1)
|
||||
})
|
||||
logger.error('Unable to connect to PostgreSQL database.', { err })
|
||||
process.exit(-1)
|
||||
})
|
||||
}
|
||||
|
||||
async function initDatabaseModels (silent: boolean) {
|
||||
sequelizeTypescript.addModels([
|
||||
|
@ -140,6 +142,7 @@ async function initDatabaseModels (silent: boolean) {
|
|||
|
||||
export {
|
||||
initDatabaseModels,
|
||||
checkDatabaseConnectionOrDie,
|
||||
sequelizeTypescript
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue