]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
fix(tests): use inline type exports to fix Windows ESM compatibility
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 1 Mar 2026 23:04:02 +0000 (00:04 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 1 Mar 2026 23:04:02 +0000 (00:04 +0100)
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.

tests/charging-station/ChargingStationTestUtils.ts
tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts

index 028c2a94569c50a287d79aa57fc972947aa6e184..72fe49ca2de7fa2fe7051cb5f212d7dc42e3d028 100644 (file)
@@ -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'
 
index 5a3b8f4d6aa5ae9551c9fcdd7b17d7e9bf4be687..87a728535cc459d89493bf445ee581497fd43dae 100644 (file)
@@ -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