From ef4fae4496e22a46f011f880cb873aba213ff1bf Mon Sep 17 00:00:00 2001 From: Saad Jutt Date: Mon, 20 Dec 2021 10:47:47 +0500 Subject: [PATCH] chore: added driveLoc for specs --- api/src/utils/connectDB.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/src/utils/connectDB.ts b/api/src/utils/connectDB.ts index c976fce..4f2c9e6 100644 --- a/api/src/utils/connectDB.ts +++ b/api/src/utils/connectDB.ts @@ -8,7 +8,10 @@ import { getRealPath } from '@sasjs/utils' export const connectDB = async () => { // NOTE: when exporting app.js as agent for supertest // we should exlcude connecting to the real database - if (process.env.NODE_ENV !== 'test') { + if (process.env.NODE_ENV === 'test') { + process.driveLoc = path.join(process.cwd(), 'tmp') + return + } else { const { MODE } = process.env if (MODE?.trim() !== 'server') {