]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
refactor(tests): harmonize test suite structure and eliminate duplication
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 28 Feb 2026 16:41:55 +0000 (17:41 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 28 Feb 2026 16:41:55 +0000 (17:41 +0100)
commit902950177e9e75eea9e73cdd89d1d2ac32f4d3b8
tree4028c404a1bf59552bc171259802a4ac674e4f2b
parent3d2431e2f36acc4768d14b7faccdf724fcd048a6
refactor(tests): harmonize test suite structure and eliminate duplication

- Consolidate 5 TransactionEvent variant files into single parameterized test
- Reduce OCPPAuthIntegration.test.ts scope (422→196 lines, focus on integration)
- Remove duplicate resetConnectorTransactionStates function, use shared utility
- Merge OCPP20AuthAdapter-Offline.test.ts into main adapter test file
- Add beforeEach hooks for mock initialization in ChargingStation tests
- Standardize OCPP requirement codes in describe blocks (I02-I04, G03)
- Consolidate eslint-disable comments with explanatory reasons
- Fix JSDoc header positions in OCPP 2.0 test files
- Use standardCleanup() for consistent timer mock reset

Net reduction: ~400 lines of test code while maintaining full coverage
20 files changed:
tests/charging-station/ChargingStation-Configuration.test.ts
tests/charging-station/ChargingStation-Connectors.test.ts
tests/charging-station/ChargingStation-Lifecycle.test.ts
tests/charging-station/ChargingStation-Resilience.test.ts
tests/charging-station/ChargingStation-Transactions.test.ts
tests/charging-station/ocpp/2.0/OCPP20CertificateManager.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-GetBaseReport.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-RemoteStartAuth.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-RequestStartTransaction.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-RequestStopTransaction.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-Reset.test.ts
tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-TransactionEvent-CableFirst.test.ts [deleted file]
tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-TransactionEvent-IdTokenFirst.test.ts [deleted file]
tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-TransactionEvent-Offline.test.ts [deleted file]
tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-TransactionEvent-Periodic.test.ts [deleted file]
tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-TransactionEvent.test.ts
tests/charging-station/ocpp/auth/OCPPAuthIntegration.test.ts
tests/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter-Offline.test.ts [deleted file]
tests/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.test.ts
tests/utils/Utils.test.ts