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:
@@ -59,6 +59,6 @@ export default setProcessVariables().then(async () => {
|
||||
|
||||
app.use(onError)
|
||||
|
||||
connectDB()
|
||||
await connectDB()
|
||||
return app
|
||||
})
|
||||
|
||||
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user