Skip to content

Commit

Permalink
Update globalSetup.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Nov 18, 2024
1 parent fb29f84 commit d8e4d52
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/tests/globalSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import bcrypt from 'bcrypt'
import mongoose from 'mongoose'
import * as bookcarsTypes from ':bookcars-types'
import * as env from '../src/config/env.config'
import * as logger from '../src/common/logger'
import * as databaseHelper from '../src/common/databaseHelper'
import User from '../src/models/User'

Expand All @@ -23,13 +24,13 @@ export default async function globalSetup() {
type: bookcarsTypes.UserType.Admin,
})
await admin.save()
console.log('globalSetup: Admin user created:', admin.id)
logger.info('globalSetup: Admin user created:', admin.id)
}
if (mongoose.connection.readyState) {
await databaseHelper.close()
}
}
} catch (err) {
console.error('Error while running global setup', err)
logger.error('Error while running global setup', err)
}
}

0 comments on commit d8e4d52

Please sign in to comment.