]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commit
fix(test-isolation): move mock instances to beforeEach in OCPP 2.0 tests
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 28 Feb 2026 15:48:00 +0000 (16:48 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 28 Feb 2026 15:48:00 +0000 (16:48 +0100)
commit9c2a803e444b5976dcc5d1fe34f1b4e19a6236d6
tree1769a7a5270f5d5a441483c1b66b7545bb1d463c
parent5df3524f59efb16d19d0d69c117dc188cb036f57
fix(test-isolation): move mock instances to beforeEach in OCPP 2.0 tests

Move module-level mock instances inside beforeEach blocks to ensure
proper test isolation per TEST_STYLE_GUIDE.md requirements.

- 11 IncomingRequestService test files fixed
- 1 VariableManager test file fixed
- 1 ServiceUtils-TransactionEvent test file fixed
- 1 TestUtils file updated with JSDoc documentation

Each test now gets fresh mock instances, eliminating potential
cross-test state contamination.
14 files changed:
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-CertificateSigned.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-ClearCache.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-DeleteCertificate.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-GetBaseReport.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-GetInstalledCertificateIds.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-GetVariables.test.ts
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-InstallCertificate.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/OCPP20IncomingRequestService-SetVariables.test.ts
tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-TransactionEvent-IdTokenFirst.test.ts
tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts
tests/charging-station/ocpp/2.0/OCPP20VariableManager.test.ts