mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
Harden Docker runtime packaging, preserve async job response semantics, fix Redis subscriber startup connections, clear lint warnings, and harden enterprise S3 object body handling.
42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
|
|
const { RedisMock } = vi.hoisted(() => ({
|
|
RedisMock: vi.fn(function RedisMock() {
|
|
return {};
|
|
}),
|
|
}));
|
|
|
|
vi.mock("ioredis", () => ({
|
|
default: RedisMock,
|
|
}));
|
|
|
|
describe("Redis connection factory", () => {
|
|
beforeEach(() => {
|
|
RedisMock.mockClear();
|
|
});
|
|
|
|
it("keeps ready checks enabled for command connections", async () => {
|
|
const { createRedisConnection } = await import("../../../../apps/api/src/jobs/connection.js");
|
|
|
|
createRedisConnection();
|
|
|
|
expect(RedisMock).toHaveBeenCalledWith(expect.any(String), {
|
|
enableReadyCheck: true,
|
|
maxRetriesPerRequest: null,
|
|
});
|
|
});
|
|
|
|
it("disables ready checks for pub/sub-only subscriber connections", async () => {
|
|
const { createRedisSubscriberConnection } = await import(
|
|
"../../../../apps/api/src/jobs/connection.js"
|
|
);
|
|
|
|
createRedisSubscriberConnection();
|
|
|
|
expect(RedisMock).toHaveBeenCalledWith(expect.any(String), {
|
|
enableReadyCheck: false,
|
|
maxRetriesPerRequest: null,
|
|
});
|
|
});
|
|
});
|