From: Jérôme Benoit Date: Fri, 27 Feb 2026 02:11:29 +0000 (+0100) Subject: fix(tests): align mock delete/stop signatures with async ChargingStation interface X-Git-Tag: ocpp-server@v3.0.0~134 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=56ea3eb7254311a0bfb7e17abfe55cdd37014f41;p=e-mobility-charging-stations-simulator.git fix(tests): align mock delete/stop signatures with async ChargingStation interface - Change delete() to async, return Promise, await stop() - Change stop() to async, return Promise - Add await Promise.resolve() for lint compliance in mock --- diff --git a/tests/charging-station/ChargingStationTestUtils.ts b/tests/charging-station/ChargingStationTestUtils.ts index b595054b..ca39f17e 100644 --- a/tests/charging-station/ChargingStationTestUtils.ts +++ b/tests/charging-station/ChargingStationTestUtils.ts @@ -561,9 +561,9 @@ export function createRealChargingStation ( } }, connectors, - delete (deleteConfiguration = true): void { + async delete (deleteConfiguration = true): Promise { if (this.started) { - this.stop() + await this.stop() } this.requests.clear() this.connectors.clear() @@ -731,10 +731,11 @@ export function createRealChargingStation ( templateIndex: index, templateName: templateFile, }, - stop (): void { + async stop (): Promise { if (this.started && !this.stopping) { this.stopping = true - // Simulate real stop behavior + // Simulate async stop behavior (immediate resolution for tests) + await Promise.resolve() this.closeWSConnection() delete this.bootNotificationResponse this.started = false