@@ -30,7 +30,7 @@ describe("rateLimitApiKey middleware", () => {
3030 query : { } ,
3131 userId : testUserId ,
3232 } ) ;
33-
33+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3434 await rateLimitApiKey ( req , res , vi . fn ( ) as any ) ;
3535
3636 expect ( res . _getStatusCode ( ) ) . toBe ( 401 ) ;
@@ -43,14 +43,15 @@ describe("rateLimitApiKey middleware", () => {
4343 query : { apiKey : "test-key" } ,
4444 userId : testUserId ,
4545 } ) ;
46-
46+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
4747 ( checkRateLimitAndThrowError as any ) . mockResolvedValueOnce ( {
4848 limit : 100 ,
4949 remaining : 99 ,
5050 reset : Date . now ( ) ,
5151 } ) ;
5252
5353 // @ts -expect-error weird typing between middleware and createMocks
54+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5455 await rateLimitApiKey ( req , res , vi . fn ( ) as any ) ;
5556
5657 expect ( checkRateLimitAndThrowError ) . toHaveBeenCalledWith ( {
@@ -74,15 +75,14 @@ describe("rateLimitApiKey middleware", () => {
7475 success : true ,
7576 } ;
7677
77- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
78- // @ts -ignore
78+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7979 ( checkRateLimitAndThrowError as any ) . mockImplementationOnce (
8080 ( { onRateLimiterResponse } : { onRateLimiterResponse : ( response : RatelimitResponse ) => void } ) => {
8181 onRateLimiterResponse ( rateLimiterResponse ) ;
8282 }
8383 ) ;
84-
8584 // @ts -expect-error weird typing between middleware and createMocks
85+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
8686 await rateLimitApiKey ( req , res , vi . fn ( ) as any ) ;
8787
8888 expect ( res . getHeader ( "X-RateLimit-Limit" ) ) . toBe ( rateLimiterResponse . limit ) ;
@@ -96,10 +96,11 @@ describe("rateLimitApiKey middleware", () => {
9696 query : { apiKey : "test-key" } ,
9797 userId : testUserId ,
9898 } ) ;
99-
99+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
100100 ( checkRateLimitAndThrowError as any ) . mockRejectedValue ( new Error ( "Rate limit exceeded" ) ) ;
101101
102102 // @ts -expect-error weird typing between middleware and createMocks
103+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
103104 await rateLimitApiKey ( req , res , vi . fn ( ) as any ) ;
104105
105106 expect ( res . _getStatusCode ( ) ) . toBe ( 429 ) ;
@@ -121,6 +122,7 @@ describe("rateLimitApiKey middleware", () => {
121122 } ;
122123
123124 // Mock rate limiter to trigger the onRateLimiterResponse callback
125+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
124126 ( checkRateLimitAndThrowError as any ) . mockImplementationOnce (
125127 ( { onRateLimiterResponse } : { onRateLimiterResponse : ( response : RatelimitResponse ) => void } ) => {
126128 onRateLimiterResponse ( rateLimiterResponse ) ;
@@ -131,6 +133,7 @@ describe("rateLimitApiKey middleware", () => {
131133 vi . mocked ( handleAutoLock ) . mockResolvedValueOnce ( true ) ;
132134
133135 // @ts -expect-error weird typing between middleware and createMocks
136+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
134137 await rateLimitApiKey ( req , res , vi . fn ( ) as any ) ;
135138
136139 expect ( handleAutoLock ) . toHaveBeenCalledWith ( {
@@ -158,6 +161,7 @@ describe("rateLimitApiKey middleware", () => {
158161 } ;
159162
160163 // Mock rate limiter to trigger the onRateLimiterResponse callback
164+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
161165 ( checkRateLimitAndThrowError as any ) . mockImplementationOnce (
162166 ( { onRateLimiterResponse } : { onRateLimiterResponse : ( response : RatelimitResponse ) => void } ) => {
163167 onRateLimiterResponse ( rateLimiterResponse ) ;
@@ -168,6 +172,7 @@ describe("rateLimitApiKey middleware", () => {
168172 vi . mocked ( handleAutoLock ) . mockRejectedValueOnce ( new Error ( "No user found for this API key." ) ) ;
169173
170174 // @ts -expect-error weird typing between middleware and createMocks
175+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
171176 await rateLimitApiKey ( req , res , vi . fn ( ) as any ) ;
172177
173178 expect ( handleAutoLock ) . toHaveBeenCalledWith ( {
@@ -195,6 +200,7 @@ describe("rateLimitApiKey middleware", () => {
195200 } ;
196201
197202 // Mock rate limiter to trigger the onRateLimiterResponse callback
203+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
198204 ( checkRateLimitAndThrowError as any ) . mockImplementationOnce (
199205 ( { onRateLimiterResponse } : { onRateLimiterResponse : ( response : RatelimitResponse ) => void } ) => {
200206 onRateLimiterResponse ( rateLimiterResponse ) ;
@@ -235,6 +241,7 @@ describe("rateLimitApiKey middleware", () => {
235241 ) ;
236242
237243 // @ts -expect-error weird typing between middleware and createMocks
244+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
238245 await rateLimitApiKey ( req , res , vi . fn ( ) as any ) ;
239246
240247 expect ( res . _getStatusCode ( ) ) . toBe ( 429 ) ;
0 commit comments