"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MockBlocklist = void 0;
const tslib_1 = require("tslib");
const express_1 = tslib_1.__importDefault(require("express"));
const shared_1 = require("./shared");
class MockBlocklist {
    initialize() {
        return tslib_1.__awaiter(this, void 0, void 0, function* () {
            const app = (0, express_1.default)();
            app.get('/blocklist', (req, res) => {
                return res.json(this.body);
            });
            this.server = yield (0, shared_1.randomListen)(app);
            return (0, shared_1.getPort)(this.server);
        });
    }
    replace(body) {
        this.body = body;
    }
    terminate() {
        return (0, shared_1.terminateServer)(this.server);
    }
}
exports.MockBlocklist = MockBlocklist;
//# sourceMappingURL=mock-plugin-blocklist.js.map