From: Jérôme Benoit Date: Sun, 1 Mar 2026 01:24:07 +0000 (+0100) Subject: refactor: restore initial mock reset code X-Git-Tag: ocpp-server@v3.0.0~46 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=505955e4e8c3b43e508ec45dd4aaf0d7d39f2617;p=e-mobility-charging-stations-simulator.git refactor: restore initial mock reset code Signed-off-by: Jérôme Benoit --- diff --git a/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-Reset.test.ts b/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-Reset.test.ts index 22698806..71ee4132 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-Reset.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-Reset.test.ts @@ -71,7 +71,6 @@ await describe('B11 & B12 - Reset', async () => { }) afterEach(() => { - mock.timers.reset() standardCleanup() }) diff --git a/tests/helpers/TestLifecycleHelpers.ts b/tests/helpers/TestLifecycleHelpers.ts index 5b30141b..9c1c2e3d 100644 --- a/tests/helpers/TestLifecycleHelpers.ts +++ b/tests/helpers/TestLifecycleHelpers.ts @@ -291,6 +291,11 @@ export function setupConnectorWithTransaction ( */ export function standardCleanup (): void { mock.restoreAll() + try { + mock.timers.reset() + } catch { + // Timers may not have been enabled, ignore + } MockSharedLRUCache.resetInstance() MockIdTagsCache.resetInstance() }