test: force real timers in mattermost reconnect tests

This commit is contained in:
Peter Steinberger 2026-04-03 22:46:10 +01:00
parent 2b54ce30ae
commit 381a865822
No known key found for this signature in database
1 changed files with 6 additions and 1 deletions

View File

@ -1,10 +1,15 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { runWithReconnect } from "./reconnect.js";
beforeEach(() => {
vi.useRealTimers();
vi.clearAllMocks();
});
afterEach(() => {
vi.useRealTimers();
});
describe("runWithReconnect", () => {
it("retries after connectFn resolves (normal close)", async () => {
let callCount = 0;