mirror of
https://github.com/sasjs/server.git
synced 2026-01-15 18:00:05 +00:00
test: fixed unhandled timout
This commit is contained in:
@@ -59,6 +59,6 @@ export default setProcessVariables().then(async () => {
|
|||||||
|
|
||||||
app.use(onError)
|
app.use(onError)
|
||||||
|
|
||||||
connectDB()
|
await connectDB()
|
||||||
return app
|
return app
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import mongoose from 'mongoose'
|
|||||||
import { populateClients } from '../routes/api/auth'
|
import { populateClients } from '../routes/api/auth'
|
||||||
import { seedDB } from './seedDB'
|
import { seedDB } from './seedDB'
|
||||||
|
|
||||||
export const connectDB = () => {
|
export const connectDB = async () => {
|
||||||
// NOTE: when exporting app.js as agent for supertest
|
// NOTE: when exporting app.js as agent for supertest
|
||||||
// we should exclude connecting to the real database
|
// we should exclude connecting to the real database
|
||||||
if (process.env.NODE_ENV === 'test') {
|
if (process.env.NODE_ENV === 'test') {
|
||||||
|
|||||||
Reference in New Issue
Block a user