]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
refactor: restore initial mock reset code
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 1 Mar 2026 01:24:07 +0000 (02:24 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 1 Mar 2026 01:24:07 +0000 (02:24 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-Reset.test.ts
tests/helpers/TestLifecycleHelpers.ts

index 2269880605f00e101eb551f95c019a6f5567c1aa..71ee41320440ac69b608ca383fb3bd883ab6ba46 100644 (file)
@@ -71,7 +71,6 @@ await describe('B11 & B12 - Reset', async () => {
   })
 
   afterEach(() => {
-    mock.timers.reset()
     standardCleanup()
   })
 
index 5b30141b8f962198db0009148580a8efa38f8e6a..9c1c2e3d6ac9deada9ca2d39d72cc76b61ea5b7c 100644 (file)
@@ -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()
 }