From 3416cd2bf1200e8da6ce49936eaf12f32ddfe4fb Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 2 Mar 2026 00:04:02 +0100 Subject: [PATCH] fix(tests): use inline type exports to fix Windows ESM compatibility Consolidate separate 'export type' and 'export' re-exports into single export block with inline 'type' keyword. This ensures proper ESM module resolution on Windows where Node.js strictly validates named exports. Reverts the workaround of splitting imports in OCPP20TestUtils.ts since the root cause (improper re-export pattern) is now fixed at source. --- .../ChargingStationTestUtils.ts | 19 ++++++++----------- .../ocpp/2.0/OCPP20TestUtils.ts | 3 +-- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/tests/charging-station/ChargingStationTestUtils.ts b/tests/charging-station/ChargingStationTestUtils.ts index 028c2a94..72fe49ca 100644 --- a/tests/charging-station/ChargingStationTestUtils.ts +++ b/tests/charging-station/ChargingStationTestUtils.ts @@ -19,22 +19,19 @@ export { standardCleanup, } from '../helpers/TestLifecycleHelpers.js' -// Re-export all helper functions and types -export type { - ChargingStationMocks, - CreateConnectorStatusOptions, - MockChargingStation, - MockChargingStationOptions, - MockChargingStationResult, - MockOCPPIncomingRequestService, - MockOCPPRequestService, -} from './helpers/StationHelpers.js' - +// Re-export all helper functions and types from StationHelpers export { + type ChargingStationMocks, cleanupChargingStation, createConnectorStatus, + type CreateConnectorStatusOptions, createMockChargingStation, createMockChargingStationTemplate, + type MockChargingStation, + type MockChargingStationOptions, + type MockChargingStationResult, + type MockOCPPIncomingRequestService, + type MockOCPPRequestService, resetChargingStationState, } from './helpers/StationHelpers.js' diff --git a/tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts b/tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts index 5a3b8f4d..87a72853 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts @@ -17,7 +17,6 @@ import type { OCPP20IdTokenType, OCPP20TransactionContext, } from '../../../../src/types/ocpp/2.0/Transaction.js' -import type { MockChargingStation } from '../../ChargingStationTestUtils.js' import { ConnectorStatusEnum, @@ -28,7 +27,7 @@ import { import { OCPP20IdTokenEnumType } from '../../../../src/types/ocpp/2.0/Transaction.js' import { Constants } from '../../../../src/utils/index.js' import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js' -import { createMockChargingStation } from '../../ChargingStationTestUtils.js' +import { createMockChargingStation, MockChargingStation } from '../../ChargingStationTestUtils.js' // ============================================================================ // Testable Interfaces -- 2.43.0