Backend CI / type-check, build, tests (push) Successful in 1m0s
Co-authored-by: Cursor <cursoragent@cursor.com>
17 lines
457 B
TypeScript
17 lines
457 B
TypeScript
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')
|