Skip to content

Commit 9be79f0

Browse files
waleedlatif1claude
andcommitted
test(rate-limit): drop needless any casts on the mock request
createMockRequest already returns NextRequest, so the casts weakened the helper's input contract in the new tests for nothing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QWh9WFMYNZ6uTFQFUzF8Bj
1 parent 44fa0b1 commit 9be79f0

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

apps/sim/lib/core/rate-limiter/route-helpers.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('route-helpers rate limiting', () => {
4949

5050
const result = await enforceIpRateLimitWithIndependentBackstop(
5151
'chat-execute',
52-
createMockRequest('POST') as any,
52+
createMockRequest('POST'),
5353
{ maxTokens: 40, refillRate: 20, refillIntervalMs: 60_000 },
5454
'chat-1'
5555
)
@@ -71,10 +71,7 @@ describe('route-helpers rate limiting', () => {
7171

7272
requestUtilsMockFns.mockGetClientIp.mockReturnValue('203.0.113.9')
7373

74-
await enforceIpRateLimitWithIndependentBackstop(
75-
'forget-password',
76-
createMockRequest('POST') as any
77-
)
74+
await enforceIpRateLimitWithIndependentBackstop('forget-password', createMockRequest('POST'))
7875

7976
expect(consume).toHaveBeenCalledWith(
8077
'route:forget-password:ip:203.0.113.9',

0 commit comments

Comments
 (0)