@@ -51,21 +51,21 @@ describe('IPRateLimiterService Test Suite', function () {
5151 describe ( 'Constructor Tests' , ( ) => {
5252 it ( 'should accept a store and initialize correctly' , ( ) => {
5353 const lruStore = new LruRateLimitStore ( duration ) ;
54- rateLimiterService = new IPRateLimiterService ( lruStore , logger , registry ) ;
54+ rateLimiterService = new IPRateLimiterService ( lruStore , registry ) ;
5555
5656 expect ( rateLimiterService . rateLimitStore ) . to . equal ( lruStore ) ;
5757 } ) ;
5858
5959 it ( 'should work with LRU store' , ( ) => {
6060 const lruStore = new LruRateLimitStore ( duration ) ;
61- rateLimiterService = new IPRateLimiterService ( lruStore , logger , registry ) ;
61+ rateLimiterService = new IPRateLimiterService ( lruStore , registry ) ;
6262
6363 expect ( rateLimiterService . rateLimitStore ) . to . be . instanceof ( LruRateLimitStore ) ;
6464 } ) ;
6565
6666 it ( 'should work with Redis store' , ( ) => {
6767 const redisStore = new RedisRateLimitStore ( mockRedisClient as unknown as RedisClientType , logger , duration ) ;
68- rateLimiterService = new IPRateLimiterService ( redisStore , logger , registry ) ;
68+ rateLimiterService = new IPRateLimiterService ( redisStore , registry ) ;
6969
7070 expect ( rateLimiterService . rateLimitStore ) . to . be . instanceof ( RedisRateLimitStore ) ;
7171 } ) ;
@@ -74,7 +74,7 @@ describe('IPRateLimiterService Test Suite', function () {
7474 describe ( 'shouldRateLimit Method Tests' , ( ) => {
7575 withOverriddenEnvsInMochaTest ( { RATE_LIMIT_DISABLED : true } , ( ) => {
7676 it ( 'should return false when RATE_LIMIT_DISABLED is true' , async ( ) => {
77- rateLimiterService = new IPRateLimiterService ( mockStore , logger , registry ) ;
77+ rateLimiterService = new IPRateLimiterService ( mockStore , registry ) ;
7878
7979 const result = await rateLimiterService . shouldRateLimit ( testIp , testMethod , testLimit , requestDetails ) ;
8080 expect ( result ) . to . be . false ;
@@ -87,7 +87,7 @@ describe('IPRateLimiterService Test Suite', function () {
8787 } ) ;
8888
8989 beforeEach ( ( ) => {
90- rateLimiterService = new IPRateLimiterService ( mockStore , logger , registry ) ;
90+ rateLimiterService = new IPRateLimiterService ( mockStore , registry ) ;
9191 } ) ;
9292
9393 it ( 'should return false when within rate limits' , async ( ) => {
@@ -150,7 +150,7 @@ describe('IPRateLimiterService Test Suite', function () {
150150
151151 beforeEach ( ( ) => {
152152 lruStore = new LruRateLimitStore ( duration ) ;
153- rateLimiterService = new IPRateLimiterService ( lruStore , logger , registry ) ;
153+ rateLimiterService = new IPRateLimiterService ( lruStore , registry ) ;
154154 } ) ;
155155
156156 it ( 'should not rate limit when within limits using LRU store' , async ( ) => {
@@ -197,7 +197,7 @@ describe('IPRateLimiterService Test Suite', function () {
197197 describe ( 'Redis Store Integration Tests' , ( ) => {
198198 it ( 'should work with Redis store' , ( ) => {
199199 const redisStore = new RedisRateLimitStore ( mockRedisClient as unknown as RedisClientType , logger , duration ) ;
200- rateLimiterService = new IPRateLimiterService ( redisStore , logger , registry ) ;
200+ rateLimiterService = new IPRateLimiterService ( redisStore , registry ) ;
201201
202202 expect ( rateLimiterService . rateLimitStore ) . to . be . instanceof ( RedisRateLimitStore ) ;
203203 } ) ;
@@ -209,7 +209,7 @@ describe('IPRateLimiterService Test Suite', function () {
209209 } as unknown as RedisClientType ;
210210
211211 const redisStore = new RedisRateLimitStore ( failingMockClient , logger , duration ) ;
212- rateLimiterService = new IPRateLimiterService ( redisStore , logger , registry ) ;
212+ rateLimiterService = new IPRateLimiterService ( redisStore , registry ) ;
213213
214214 // Should not rate limit when Redis operations fail (fail-open behavior)
215215 const result = await rateLimiterService . shouldRateLimit ( testIp , testMethod , testLimit , requestDetails ) ;
@@ -220,7 +220,7 @@ describe('IPRateLimiterService Test Suite', function () {
220220 // Ensure store.incrementAndCheck is not called when rate limiting is disabled
221221 withOverriddenEnvsInMochaTest ( { RATE_LIMIT_DISABLED : true } , ( ) => {
222222 it ( 'should not call store.incrementAndCheck when rate limit is disabled' , async ( ) => {
223- rateLimiterService = new IPRateLimiterService ( mockStore , logger , registry ) ;
223+ rateLimiterService = new IPRateLimiterService ( mockStore , registry ) ;
224224 const result = await rateLimiterService . shouldRateLimit ( testIp , testMethod , testLimit , requestDetails ) ;
225225 expect ( result ) . to . be . false ;
226226 expect ( mockStore . incrementAndCheck . notCalled ) . to . be . true ;
0 commit comments