diff --git a/apis/product/config/index.js b/apis/product/config/index.js index 6ef7595..d290792 100644 --- a/apis/product/config/index.js +++ b/apis/product/config/index.js @@ -1,4 +1,4 @@ -export const mongoosasticSettings = { +export const mongoosasticSettings = (process.env.NODE_ENV === 'test') ? {} : { hosts: process.env.ELASTICSEARCH, port: process.env.ESPORT, bulk: { diff --git a/apis/product/package.json b/apis/product/package.json index 4378778..4673bad 100644 --- a/apis/product/package.json +++ b/apis/product/package.json @@ -9,7 +9,7 @@ ] }, "scripts": { - "test": "jest --runInBand --setupFiles dotenv/config --forceExit", + "test": "NODE_ENV=test jest --runInBand --setupFiles dotenv/config --forceExit", "precommit": "lint-staged && yarn test", "dev:start": "nodemon --exec babel-node bin/www.js", "build": "babel ./ -d build --copy-files '*.json'",