"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestHarness = void 0;
const config_1 = require("@nestjs/config");
const testing_1 = require("@nestjs/testing");
const app_toolkit_module_1 = require("../../app-toolkit/app-toolkit.module");
const apps_module_1 = require("../../apps/apps.module");
class TestHarness {
    setup() {
        return __awaiter(this, void 0, void 0, function* () {
            const testModule = testing_1.Test.createTestingModule({
                imports: [
                    apps_module_1.AppsModule.registerAsync({
                        appToolkitModule: app_toolkit_module_1.AppToolkitModule,
                    }),
                    config_1.ConfigModule.forRoot({
                        isGlobal: true,
                        load: [
                            () => {
                                var _a, _b;
                                return ({
                                    zapperApi: {
                                        url: (_a = process.env.ZAPPER_API_URL) !== null && _a !== void 0 ? _a : 'https://api.zapper.fi',
                                        key: (_b = process.env.ZAPPER_API_KEY) !== null && _b !== void 0 ? _b : 'ad01527e-8133-4a68-ad67-fbf8d9040ad1',
                                    },
                                });
                            },
                        ],
                    }),
                ],
            });
            this.moduleRef = yield testModule.compile();
        });
    }
    teardown() {
        return __awaiter(this, void 0, void 0, function* () {
            if (this.app)
                yield this.app.close();
        });
    }
}
exports.TestHarness = TestHarness;
//# sourceMappingURL=harness.js.map