Files

17 lines
457 B
TypeScript
Raw Permalink Normal View History

import assert from 'node:assert/strict'
import { assertAuthRateLimit } from '../src/common/rate-limit/auth-rate-limit'
let threw = false
for (let i = 0; i < 35; i++) {
try {
assertAuthRateLimit('test-client-429')
} catch (error) {
threw = true
assert.equal((error as { status?: number }).status, 429)
break
}
}
assert.equal(threw, true, 'expected rate limit after repeated auth attempts')
console.log('auth-rate-limit tests passed')