"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const runQuirrel_1 = require("./runQuirrel");
const supertest_1 = __importDefault(require("supertest"));
test("rate limiter", async () => {
    const env = await (0, runQuirrel_1.run)("Mock", {
        rateLimiter: {
            max: 2,
        },
    });
    const endpoint = "/queues/" + encodeURIComponent("https://example.com");
    const req = (token = "") => (0, supertest_1.default)(env.server)
        .post(endpoint)
        .auth(token, { type: "bearer" })
        .send({ body: "" });
    await req("foo").expect(201);
    await req("foo").expect(201);
    await req("foo").expect(429);
    await req("bar").expect(201);
    await env.teardown();
});
//# sourceMappingURL=rate_limit.test.js.map