Skip to content

Commit

Permalink
Fix rate limiter test in RateLimiter.spec.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
ashtrindade committed May 1, 2024
1 parent f4392f5 commit 1f5681a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/unit/src/middleware/RateLimiter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ jest.mock('express-rate-limit')

describe('RateLimiter middleware', () => {
it('should call express-rate-limit with the correct configuration', () => {
rateLimiter
expect(rateLimit).toHaveBeenCalledWith({
windowMs: 60 * 1000 * 10,
max: 10,
message: 'Too many requests, please try again later.'
})
})

it('should fail', () => {
expect(rateLimiter).toBeUndefined()
})
})

0 comments on commit 1f5681a

Please sign in to comment.