"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const plugins_testing_1 = require("@unblocked-web/plugins-testing");
const RequestSession_1 = require("@unblocked-web/agent-mitm/handlers/RequestSession");
const MitmProxy_1 = require("@unblocked-web/agent-mitm/lib/MitmProxy");
const lookupPublicIp_1 = require("../lib/helpers/lookupPublicIp");
afterAll(plugins_testing_1.Helpers.afterAll);
afterEach(plugins_testing_1.Helpers.afterEach);
test('can resolve a v4 address', async () => {
    await expect((0, lookupPublicIp_1.default)()).resolves.toBeTruthy();
});
test('can resolve an ip address with a mitm socket', async () => {
    const mitmServer = await MitmProxy_1.default.start(null);
    plugins_testing_1.Helpers.needsClosing.push(mitmServer);
    const session = new RequestSession_1.default(`1`, {}, plugins_testing_1.TestLogger.forTest(module));
    mitmServer.registerSession(session, false);
    plugins_testing_1.Helpers.needsClosing.push(session);
    await expect((0, lookupPublicIp_1.default)(lookupPublicIp_1.IpLookupServices.aws, session.requestAgent)).resolves.toBeTruthy();
});
//# sourceMappingURL=publicIp.test.js.map