From: Jérôme Benoit Date: Fri, 26 Jul 2024 15:44:04 +0000 (+0200) Subject: refactor(test): code cleanups X-Git-Tag: ocpp-server@v1.5.1~12 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7edfbc133ab8b7d617cbb1e4fbda4acd4c63800d;p=e-mobility-charging-stations-simulator.git refactor(test): code cleanups Signed-off-by: Jérôme Benoit --- diff --git a/tests/charging-station/Helpers.test.ts b/tests/charging-station/Helpers.test.ts index 2a3c799c..15f72f3b 100644 --- a/tests/charging-station/Helpers.test.ts +++ b/tests/charging-station/Helpers.test.ts @@ -12,6 +12,7 @@ import { BaseError } from '../../src/exception/index.js' import { type ChargingStationInfo, type ChargingStationTemplate, + type ConnectorStatus, type EvseStatus, OCPPVersion, } from '../../src/types/index.js' @@ -21,7 +22,10 @@ await describe('Helpers test suite', async () => { const chargingStationTemplate = { baseName, } as ChargingStationTemplate - const chargingStation = {} as ChargingStation + const chargingStation = { + evses: new Map(), + connectors: new Map(), + } as ChargingStation await it('Verify getChargingStationId()', t => { expect(getChargingStationId(1, chargingStationTemplate)).toBe(`${baseName}-00001`) @@ -101,7 +105,6 @@ await describe('Helpers test suite', async () => { expect(() => { validateStationInfo(chargingStation) }).not.toThrow() - chargingStation.evses = new Map() chargingStation.stationInfo.ocppVersion = OCPPVersion.VERSION_201 expect(() => { validateStationInfo(chargingStation)