From: Jérôme Benoit Date: Fri, 27 Feb 2026 20:05:21 +0000 (+0100) Subject: fix(tests): bind method reference in ClearCache test X-Git-Tag: ocpp-server@v3.0.0~105 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=efeb46596faccf917c4ffc742da13e31f49cae2d;p=e-mobility-charging-stations-simulator.git fix(tests): bind method reference in ClearCache test - Use .bind() for deleteIdTags method reference (line 89) - Ensures proper 'this' context when method is restored and called - Reduces lint errors from 41 to 40 (1 error fixed) - All 291 tests still passing --- diff --git a/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-ClearCache.test.ts b/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-ClearCache.test.ts index 1fb02a07..d1e9b2f6 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-ClearCache.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-ClearCache.test.ts @@ -86,7 +86,7 @@ await describe('C11 - Clear Authorization Data in Authorization Cache', async () await it('Should NOT call idTagsCache.deleteIdTags() on ClearCache request', async () => { // Verify that IdTagsCache is not touched let deleteIdTagsCalled = false - const originalDeleteIdTags = mockChargingStation.idTagsCache.deleteIdTags + const originalDeleteIdTags = mockChargingStation.idTagsCache.deleteIdTags.bind(mockChargingStation.idTagsCache) Object.assign(mockChargingStation.idTagsCache, { deleteIdTags: () => {