mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: harden Docker image and async job responses
Harden Docker runtime packaging, preserve async job response semantics, fix Redis subscriber startup connections, clear lint warnings, and harden enterprise S3 object body handling.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
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,
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user