test(telegram): force real timers for media groups

This commit is contained in:
Peter Steinberger
2026-01-10 03:44:12 +00:00
parent 241bc737cf
commit 0f409cb99d

View File

@@ -1,4 +1,4 @@
import { describe, expect, it, vi } from "vitest";
import { beforeEach, describe, expect, it, vi } from "vitest";
const useSpy = vi.fn();
const middlewareUseSpy = vi.fn();
@@ -235,6 +235,11 @@ describe("telegram inbound media", () => {
});
describe("telegram media groups", () => {
beforeEach(() => {
// These tests rely on real setTimeout aggregation; guard against leaked fake timers.
vi.useRealTimers();
});
const MEDIA_GROUP_POLL_TIMEOUT_MS =
process.platform === "win32" ? 30_000 : 15_000;
const MEDIA_GROUP_TEST_TIMEOUT_MS =