]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
test(charging-station): add Heartbeat/Ping and Error Recovery tests
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 27 Feb 2026 07:37:00 +0000 (08:37 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 27 Feb 2026 14:00:19 +0000 (15:00 +0100)
commitc09024faf101254d03ae173895ca009d10b5015f
tree5ea00138838261f44309b80b85155503ceb31071
parent62d293816286e6925404b76abd7864721f6be14e
test(charging-station): add Heartbeat/Ping and Error Recovery tests

Implement Wave 3 advanced tests covering timing intervals and error handling.

Heartbeat/Ping Intervals (13 tests):
- Add heartbeat start/stop/restart tests
- Add WebSocket ping interval tests
- Add meter values interval tests
- Add OCPP 2.0 transaction update interval tests
- Use timer mocking for fast execution

Error Recovery/Resilience (13 tests):
- Add reconnection logic tests with exponential backoff
- Add error handling tests for invalid messages
- Add graceful degradation tests
- Add cleanup verification tests
- All error scenarios handled without crashes

Total: 26 new tests (243 tests total)
All tests pass in 2.9s.
tests/charging-station/ChargingStation.test.ts
tests/charging-station/ChargingStationTestUtils.ts