mirror of
https://github.com/sasjs/server.git
synced 2026-01-03 21:10:05 +00:00
test: fixed specs
This commit is contained in:
@@ -2,19 +2,6 @@ import mongoose from 'mongoose'
|
||||
import { seedDB } from './seedDB'
|
||||
|
||||
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') {
|
||||
return
|
||||
}
|
||||
|
||||
const { MODE } = process.env
|
||||
|
||||
if (MODE?.trim() !== 'server') {
|
||||
console.log('Running in Desktop Mode, no DB to connect.')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await mongoose.connect(process.env.DB_CONNECT as string)
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user