Files
dex/pkg/api
zeekay b2ca3bfd36 test: improve pkg/api coverage from 70.5% to 79.9%
Add comprehensive unit tests for api package:
- IPRateLimiter tests (NewIPRateLimiter, Allow, cleanup, concurrent access)
- getClientIP tests (X-Forwarded-For variants, RemoteAddr with/without port)
- JSONRPCServer rate limiting tests
- processMessage tests (invalid type, unknown type, various message types)
- Handler edge cases (missing fields, invalid formats, authentication states)
- notifyLiquidation tests (client found, not found, sell side)
- broadcastToSubscribers tests (no clients, full channel)
- Concurrent access tests for rate limiter and server metrics

Coverage improved from 70.5% to 79.9%. Remaining uncovered code
(readPump, writePump, HandleConnection, Start, marketDataBroadcaster,
positionMonitor, metricsReporter) requires integration testing with
actual WebSocket connections.
2025-12-11 17:09:28 -08:00
..