fix: resolve promise on charging station events once
[e-mobility-charging-stations-simulator.git] / src / charging-station / Helpers.ts
index 492d26aa10dbeb5a5d028e1a7d6d111c291ac368..4f34fe180a33b01714466c4fb3cc792335863965 100644 (file)
@@ -649,6 +649,7 @@ export const waitChargingStationEvents = async (
     let events = 0;
     if (eventsToWait === 0) {
       resolve(events);
+      return;
     }
     emitter.on(event, () => {
       ++events;