]>
Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
test(utils): add exponentialDelay backoff algorithm tests
WebSocket Exponential Backoff Algorithm Tests (7 tests):
- Verify default parameters (2^n * 100ms + jitter)
- Verify custom delayFactor parameter
- Verify exponential growth pattern (each delay ~2x previous)
- Verify random jitter produces variation (not deterministic)
- Verify jitter is within 0-20% range per spec
- Verify edge cases (default retry, large retry, small factor)
- Verify WebSocket reconnection scenarios (retry 1, 5, 10)
Tests cover the exponentialDelay() utility function used by
ChargingStation.reconnect() when reconnectExponentialDelay is enabled.
All tests pass.