Files
gold_land_server/test/auth-rate-limit.test.ts
safavimohadeseh78andCursor dfb20ca92c
Backend CI / type-check, build, tests (push) Successful in 1m0s
feat: prepare six-lesson trial backend with reliable rewards and operations
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-12 14:35:42 +03:30

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')