From: Jérôme Benoit Date: Sun, 17 Dec 2023 20:23:12 +0000 (+0100) Subject: fix: resolve promise on charging station events once X-Git-Tag: v1.2.30~9 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=2def357c05fcea4eeeaa4e0c5c8660a5cf290d2e;p=e-mobility-charging-stations-simulator.git fix: resolve promise on charging station events once Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/Helpers.ts b/src/charging-station/Helpers.ts index 492d26aa..4f34fe18 100644 --- a/src/charging-station/Helpers.ts +++ b/src/charging-station/Helpers.ts @@ -649,6 +649,7 @@ export const waitChargingStationEvents = async ( let events = 0; if (eventsToWait === 0) { resolve(events); + return; } emitter.on(event, () => { ++events;