chore: Fix types in tests 38/N.

This commit is contained in:
cpojer
2026-02-17 15:47:23 +09:00
parent 238718c1d8
commit 084e39b519
19 changed files with 85 additions and 40 deletions

View File

@@ -7,10 +7,15 @@ function createLimiterSpy(): AuthRateLimiter & {
recordFailure: ReturnType<typeof vi.fn>;
reset: ReturnType<typeof vi.fn>;
} {
const check = vi.fn<AuthRateLimiter["check"]>(
(_ip, _scope) => ({ allowed: true, remaining: 10, retryAfterMs: 0 }) as const,
);
const recordFailure = vi.fn<AuthRateLimiter["recordFailure"]>((_ip, _scope) => {});
const reset = vi.fn<AuthRateLimiter["reset"]>((_ip, _scope) => {});
return {
check: vi.fn(() => ({ allowed: true, remaining: 10, retryAfterMs: 0 })),
recordFailure: vi.fn(),
reset: vi.fn(),
check,
recordFailure,
reset,
size: () => 0,
prune: () => {},
dispose: () => {},