"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const __1 = require("..");
const runQuirrel_1 = require("../../api/test/runQuirrel");
const util_1 = require("./util");
test("getAll", async () => {
    const server = await (0, runQuirrel_1.run)("Mock");
    const quirrel = new __1.QuirrelClient({
        route: "",
        async handler() { },
        config: {
            quirrelBaseUrl: (0, util_1.getAddress)(server.server),
            encryptionSecret: "4ws8syoOgeQX6WFvXuUneGNwy7QvLxpk",
            applicationBaseUrl: "http://localhost",
        },
    });
    const jobs = await quirrel.enqueueMany([
        {
            payload: "hello world",
            options: {
                delay: "20s",
            },
        },
        {
            payload: "hello world",
            options: {
                delay: "20s",
            },
        },
        {
            payload: "hello world",
            options: {
                delay: "20s",
            },
        },
    ]);
    const iterator = quirrel.get();
    const { value: fetchedJobs, done } = await iterator.next();
    expect(fetchedJobs.map((v) => JSON.stringify(v)).sort()).toEqual(jobs.map((v) => JSON.stringify(v)).sort());
    expect(done).toBe(false);
    expect((await iterator.next()).done).toBe(true);
    server.teardown();
});
//# sourceMappingURL=getall.test.js.map