perf: cut cold route compilation and unblock preview images (#6441)
This commit is contained in:
1 parent
622e1dcfa5
commit
b32ad82850
182 files changed
+11421
-2339
No files matched your search
@@ -0,0 +1,21 @@
|
||||
// @vitest-environment node
|
||||
|
||||
import { describe, expect, test, vi } from "vitest";
|
||||
|
||||
vi.mock("./connection", () => ({
|
||||
createRedisConnection: () => null,
|
||||
}));
|
||||
|
||||
import { createLockChannel } from "./channel";
|
||||
|
||||
describe("createLockChannel", () => {
|
||||
test("degrades gracefully when Redis connections are disabled", async () => {
|
||||
const lock = createLockChannel("test-lock");
|
||||
|
||||
const token = await lock.acquireAsync(60);
|
||||
|
||||
expect(token).toEqual(expect.any(String));
|
||||
if (!token) throw new Error("Expected the fallback lock to return a token");
|
||||
await expect(lock.releaseAsync(token)).resolves.toBeUndefined();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user