1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-10 11:24:35 +00:00

test: fixed unhandled timout

This commit is contained in:
Saad Jutt
2022-04-20 00:06:21 +05:00
parent d55a619d64
commit 9fc7a132ba
2 changed files with 2 additions and 2 deletions

View File

@@ -59,6 +59,6 @@ export default setProcessVariables().then(async () => {
app.use(onError)
connectDB()
await connectDB()
return app
})

View File

@@ -2,7 +2,7 @@ import mongoose from 'mongoose'
import { populateClients } from '../routes/api/auth'
import { seedDB } from './seedDB'
export const connectDB = () => {
export const connectDB = async () => {
// NOTE: when exporting app.js as agent for supertest
// we should exclude connecting to the real database
if (process.env.NODE_ENV === 'test') {