test: fix broken suites

This commit is contained in:
Linus Rath
2026-07-22 18:56:09 +02:00
parent 3f22a3323a
commit 813185e58d
6 changed files with 30 additions and 10 deletions
@@ -302,6 +302,11 @@ describe('JMAPClient resilience', () => {
});
it('does not mark the connection lost or reconnect repeatedly while rate limited', async () => {
// The file-level shouldAdvanceTime lets fake time creep forward with
// the wall clock, which can fire the 30s keep-alive an extra time on a
// slow or loaded machine. This test counts pings, so pin the clock and
// advance it explicitly.
vi.useFakeTimers({ shouldAdvanceTime: false });
const client = await createConnectedClient();
const callback = vi.fn();
client.onConnectionChange(callback);