From f0f7f42e48d90c50fbe89bbb2030e1626c636a14 Mon Sep 17 00:00:00 2001 From: fathiaoyinloye Date: Mon, 29 Jun 2026 13:32:23 +0100 Subject: [PATCH] test: restore real timers after rate limit tests --- src/app/api/tutorials/__tests__/ratelimit.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app/api/tutorials/__tests__/ratelimit.test.ts b/src/app/api/tutorials/__tests__/ratelimit.test.ts index 2372af09..39a6b11b 100644 --- a/src/app/api/tutorials/__tests__/ratelimit.test.ts +++ b/src/app/api/tutorials/__tests__/ratelimit.test.ts @@ -26,6 +26,11 @@ describe('slidingWindowRateLimit', () => { vi.useFakeTimers(); }); + afterEach(() => { + vi.useRealTimers(); + }); + + it('allows requests within the limit', () => { const config = { limit: 3, windowMs: 60_000 }; const id = `test-read-${Date.now()}`;