Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/llms-txt-hub / apps/web/__mocks__/@thedaviddias/rate-limiting.ts |
| Date | Not specified in source |
| Repository | Janady13/llms-txt-hub |
| Revision | e0f4bf978d4df168369c7601d9c5f5ea89e84377 |
| Branch | main |
| Path or archive member | apps/web/__mocks__/@thedaviddias/rate-limiting.ts |
| Original SHA-256 | 8b91f1e5e819018778617b7725316a2555e8f234258b0e662b7bdacf4acc9ca1 |
| Git blob SHA | 4506ddd94d7641f28466ec1e06ee808a140d5cbc |
| Reading-copy SHA-256 | 8b91f1e5e819018778617b7725316a2555e8f234258b0e662b7bdacf4acc9ca1 |
Recovered source transcript
Download complete source text ↓25 lines · 0.6 KB
// Mock for @thedaviddias/rate-limiting to avoid Upstash Redis dependency in tests
/**
* Mock rate limiter that bypasses rate limiting in tests
*/
export const withRateLimit = async (request: any, rateLimitType: string, handler: any) => {
// In tests, just call the handler directly without rate limiting
return await handler()
}
export const checkRateLimit = jest.fn(() => ({
allowed: true,
remaining: 10,
resetTime: Date.now() + 60000
}))
export const RATE_LIMIT_EXCEEDED_MESSAGE = 'Too many requests'
// Mock any other exports the package might have
export default {
withRateLimit,
checkRateLimit,
RATE_LIMIT_EXCEEDED_MESSAGE
}