UNPKG

e1c-test-tools

Version:

Набор инструментов для тестирования (предварительная версия)

21 lines (20 loc) 751 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const dotenv_1 = require("dotenv"); const utils_1 = require("../lib/utils"); const test_env_1 = require("../lib/test-env"); dotenv_1.config(); const brokerHost = process.env.BROKER_HOST || '127.0.0.1'; const brokerPort = process.env.BROKER_PORT || '3000'; const shutDownEnv = async () => { // eslint-disable-next-line no-underscore-dangle const broker = global.__BROKER__; // if broker not empty then we have to run tear down // else we left running e1c with broker if (broker) { test_env_1.shutdownE1c(brokerHost, brokerPort); await utils_1.sleep(200); broker.close(); } }; exports.default = shutDownEnv;