1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-02 04:50:04 +00:00

test: fixed unhandled timeout

This commit is contained in:
Saad Jutt
2022-04-20 06:50:11 +05:00
parent d55a619d64
commit 7fe43ae0b7
9 changed files with 54 additions and 56 deletions

View File

@@ -7,22 +7,22 @@ export const connectDB = () => {
// we should exclude connecting to the real database
if (process.env.NODE_ENV === 'test') {
return
} else {
const { MODE } = process.env
if (MODE?.trim() !== 'server') {
console.log('Running in Destop Mode, no DB to connect.')
return
}
mongoose.connect(process.env.DB_CONNECT as string, async (err) => {
if (err) throw err
console.log('Connected to db!')
await seedDB()
await populateClients()
})
}
const { MODE } = process.env
if (MODE?.trim() !== 'server') {
console.log('Running in Destop Mode, no DB to connect.')
return
}
mongoose.connect(process.env.DB_CONNECT as string, async (err) => {
if (err) throw err
console.log('Connected to db!')
await seedDB()
await populateClients()
})
}