"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.intBeforeHelper = intBeforeHelper;
exports.intAfterHelper = intAfterHelper;
const config_1 = __importDefault(require("../../src/config"));
const modules_1 = require("../../src/modules");
const storage_1 = require("../../src/services/storage");
const utils_1 = require("../../src/utils");
const storageArgs = {
    dbHost: config_1.default.dbHost,
    dbName: 'bitcore-integration'
};
let loaded = false;
async function intBeforeHelper() {
    try {
        if (!loaded) {
            modules_1.Modules.loadConfigured();
            loaded = true;
        }
        if (!storage_1.Storage.connected) {
            await storage_1.Storage.start(storageArgs);
            await (0, utils_1.wait)(2000);
        }
    }
    catch (e) {
        console.error(e);
    }
}
async function intAfterHelper(describeContext) {
    try {
        if (describeContext && describeContext.timeout) {
            describeContext.timeout(1);
        }
    }
    catch (e) {
        console.error(e);
    }
}
//# sourceMappingURL=integration.js.map