From 665659308a1c771e5f88fa37ae7840454ec4e645 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 19 Mar 2026 16:11:03 +0100 Subject: [PATCH] refactor: harmonize barrel usage across all test files Redirect all direct module imports (utils/Logger, utils/Constants, worker/WorkerTypes, types/*, charging-station/ChargingStation) to their respective barrel index.js in test files. Unit tests of the module itself retain direct imports per convention. --- .../AutomaticTransactionGenerator.test.ts | 2 +- .../ChargingStation-Configuration.test.ts | 2 +- tests/charging-station/ChargingStation-Connectors.test.ts | 2 +- tests/charging-station/ChargingStation-Lifecycle.test.ts | 2 +- tests/charging-station/ChargingStation-Resilience.test.ts | 2 +- .../charging-station/ChargingStation-Transactions.test.ts | 2 +- tests/charging-station/ChargingStation.test.ts | 2 +- tests/charging-station/ConfigurationKeyUtils.test.ts | 2 +- tests/charging-station/Helpers.test.ts | 2 +- tests/charging-station/IdTagsCache.test.ts | 2 +- tests/charging-station/helpers/StationHelpers.ts | 2 +- ...CPP16IncomingRequestService-ChangeAvailability.test.ts | 2 +- ...6IncomingRequestService-RemoteStartTransaction.test.ts | 2 +- .../OCPP16IncomingRequestService-RemoteStopUnlock.test.ts | 2 +- .../1.6/OCPP16IncomingRequestService-Reservation.test.ts | 2 +- .../ocpp/1.6/OCPP16Integration-Reservations.test.ts | 2 +- .../ocpp/1.6/OCPP16Integration-Transactions.test.ts | 2 +- .../ocpp/1.6/OCPP16ResponseService-Transactions.test.ts | 2 +- tests/charging-station/ocpp/1.6/OCPP16TestUtils.ts | 8 +++----- .../OCPP20IncomingRequestService-RemoteStartAuth.test.ts | 4 ++-- .../2.0/OCPP20ResponseService-TransactionEvent.test.ts | 2 +- .../ocpp/2.0/OCPP20ServiceUtils-TransactionEvent.test.ts | 2 +- tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts | 6 +++--- .../ocpp/2.0/OCPP20VariableManager.test.ts | 2 +- .../ocpp/OCPPServiceUtils-connectorStatus.test.ts | 2 +- tests/charging-station/ocpp/OCPPServiceUtils-pure.test.ts | 2 +- .../ocpp/OCPPServiceUtils-validation.test.ts | 2 +- .../ocpp/auth/OCPPAuthIntegration.test.ts | 2 +- .../ocpp/auth/adapters/OCPP16AuthAdapter.test.ts | 2 +- .../ocpp/auth/adapters/OCPP20AuthAdapter.test.ts | 2 +- tests/charging-station/ocpp/auth/helpers/MockFactories.ts | 2 +- .../ocpp/auth/services/OCPPAuthServiceFactory.test.ts | 2 +- .../ocpp/auth/services/OCPPAuthServiceImpl.test.ts | 2 +- .../ocpp/auth/strategies/CertificateAuthStrategy.test.ts | 2 +- tests/exception/OCPPError.test.ts | 2 +- tests/helpers/OCPPAuthIntegrationTest.ts | 4 ++-- tests/helpers/TestLifecycleHelpers.ts | 2 +- tests/performance/storage/MikroOrmStorage.test.ts | 3 +-- tests/performance/storage/MongoDBStorage.test.ts | 3 +-- tests/utils/ChargingStationConfigurationUtils.test.ts | 2 +- tests/utils/Configuration.test.ts | 2 +- tests/utils/ErrorUtils.test.ts | 4 ++-- tests/utils/FileUtils.test.ts | 2 +- tests/utils/MessageChannelUtils.test.ts | 2 +- tests/utils/Utils.test.ts | 2 +- 45 files changed, 52 insertions(+), 56 deletions(-) diff --git a/tests/charging-station/AutomaticTransactionGenerator.test.ts b/tests/charging-station/AutomaticTransactionGenerator.test.ts index 1fa13994..fa8b420b 100644 --- a/tests/charging-station/AutomaticTransactionGenerator.test.ts +++ b/tests/charging-station/AutomaticTransactionGenerator.test.ts @@ -17,7 +17,7 @@ import assert from 'node:assert/strict' import { afterEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../src/charging-station/index.js' import { AutomaticTransactionGenerator } from '../../src/charging-station/AutomaticTransactionGenerator.js' import { BaseError } from '../../src/exception/index.js' diff --git a/tests/charging-station/ChargingStation-Configuration.test.ts b/tests/charging-station/ChargingStation-Configuration.test.ts index 9cb52120..4fa0224a 100644 --- a/tests/charging-station/ChargingStation-Configuration.test.ts +++ b/tests/charging-station/ChargingStation-Configuration.test.ts @@ -5,7 +5,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../src/charging-station/index.js' import { AvailabilityType, RegistrationStatusEnumType } from '../../src/types/index.js' import { standardCleanup, withMockTimers } from '../helpers/TestLifecycleHelpers.js' diff --git a/tests/charging-station/ChargingStation-Connectors.test.ts b/tests/charging-station/ChargingStation-Connectors.test.ts index adfd2747..d342f95e 100644 --- a/tests/charging-station/ChargingStation-Connectors.test.ts +++ b/tests/charging-station/ChargingStation-Connectors.test.ts @@ -5,7 +5,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../src/charging-station/index.js' import { RegistrationStatusEnumType } from '../../src/types/index.js' import { standardCleanup } from '../helpers/TestLifecycleHelpers.js' diff --git a/tests/charging-station/ChargingStation-Lifecycle.test.ts b/tests/charging-station/ChargingStation-Lifecycle.test.ts index 1f2536d6..589fa193 100644 --- a/tests/charging-station/ChargingStation-Lifecycle.test.ts +++ b/tests/charging-station/ChargingStation-Lifecycle.test.ts @@ -5,7 +5,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../src/charging-station/index.js' import { standardCleanup } from '../helpers/TestLifecycleHelpers.js' import { cleanupChargingStation, createMockChargingStation } from './ChargingStationTestUtils.js' diff --git a/tests/charging-station/ChargingStation-Resilience.test.ts b/tests/charging-station/ChargingStation-Resilience.test.ts index 525c168f..b77779fc 100644 --- a/tests/charging-station/ChargingStation-Resilience.test.ts +++ b/tests/charging-station/ChargingStation-Resilience.test.ts @@ -5,7 +5,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../src/charging-station/index.js' import { RegistrationStatusEnumType, RequestCommand } from '../../src/types/index.js' import { standardCleanup } from '../helpers/TestLifecycleHelpers.js' diff --git a/tests/charging-station/ChargingStation-Transactions.test.ts b/tests/charging-station/ChargingStation-Transactions.test.ts index 37ea1bc8..2ee122d7 100644 --- a/tests/charging-station/ChargingStation-Transactions.test.ts +++ b/tests/charging-station/ChargingStation-Transactions.test.ts @@ -5,7 +5,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../src/charging-station/index.js' import { OCPPVersion } from '../../src/types/index.js' import { standardCleanup, withMockTimers } from '../helpers/TestLifecycleHelpers.js' diff --git a/tests/charging-station/ChargingStation.test.ts b/tests/charging-station/ChargingStation.test.ts index d1fa3ad0..829eabab 100644 --- a/tests/charging-station/ChargingStation.test.ts +++ b/tests/charging-station/ChargingStation.test.ts @@ -11,7 +11,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../src/charging-station/index.js' import { RegistrationStatusEnumType } from '../../src/types/index.js' import { standardCleanup } from '../helpers/TestLifecycleHelpers.js' diff --git a/tests/charging-station/ConfigurationKeyUtils.test.ts b/tests/charging-station/ConfigurationKeyUtils.test.ts index 65a93d5a..c61c9566 100644 --- a/tests/charging-station/ConfigurationKeyUtils.test.ts +++ b/tests/charging-station/ConfigurationKeyUtils.test.ts @@ -13,7 +13,7 @@ import { getConfigurationKey, setConfigurationKeyValue, } from '../../src/charging-station/ConfigurationKeyUtils.js' -import { logger } from '../../src/utils/Logger.js' +import { logger } from '../../src/utils/index.js' import { standardCleanup } from '../helpers/TestLifecycleHelpers.js' import { createMockChargingStation } from './ChargingStationTestUtils.js' diff --git a/tests/charging-station/Helpers.test.ts b/tests/charging-station/Helpers.test.ts index 8ff2332c..3bba97cf 100644 --- a/tests/charging-station/Helpers.test.ts +++ b/tests/charging-station/Helpers.test.ts @@ -31,7 +31,7 @@ import { OCPPVersion, type Reservation, } from '../../src/types/index.js' -import { logger } from '../../src/utils/Logger.js' +import { logger } from '../../src/utils/index.js' import { standardCleanup } from '../helpers/TestLifecycleHelpers.js' import { TEST_CHARGING_STATION_BASE_NAME } from './ChargingStationTestConstants.js' import { diff --git a/tests/charging-station/IdTagsCache.test.ts b/tests/charging-station/IdTagsCache.test.ts index 6ff8d73b..5e5bf081 100644 --- a/tests/charging-station/IdTagsCache.test.ts +++ b/tests/charging-station/IdTagsCache.test.ts @@ -15,7 +15,7 @@ import { tmpdir } from 'node:os' import { join } from 'node:path' import { afterEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../src/charging-station/index.js' import { getIdTagsFile } from '../../src/charging-station/Helpers.js' import { IdTagsCache } from '../../src/charging-station/IdTagsCache.js' diff --git a/tests/charging-station/helpers/StationHelpers.ts b/tests/charging-station/helpers/StationHelpers.ts index 3622e790..5010a709 100644 --- a/tests/charging-station/helpers/StationHelpers.ts +++ b/tests/charging-station/helpers/StationHelpers.ts @@ -4,7 +4,7 @@ * Factory functions to create mock ChargingStation instances with isolated dependencies. */ -import type { ChargingStation } from '../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../src/charging-station/index.js' import type { ChargingStationInfo, ChargingStationOcppConfiguration, diff --git a/tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-ChangeAvailability.test.ts b/tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-ChangeAvailability.test.ts index 426785ac..e438b68e 100644 --- a/tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-ChangeAvailability.test.ts +++ b/tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-ChangeAvailability.test.ts @@ -8,7 +8,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../src/charging-station/index.js' import type { TestableOCPP16IncomingRequestService } from '../../../../src/charging-station/ocpp/1.6/__testable__/index.js' import { diff --git a/tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-RemoteStartTransaction.test.ts b/tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-RemoteStartTransaction.test.ts index d3ddeeef..4fb6e6ad 100644 --- a/tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-RemoteStartTransaction.test.ts +++ b/tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-RemoteStartTransaction.test.ts @@ -8,7 +8,7 @@ import type { mock } from 'node:test' import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../src/charging-station/index.js' import type { RemoteStartTransactionRequest } from '../../../../src/types/index.js' import { OCPP16IncomingRequestService } from '../../../../src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.js' diff --git a/tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-RemoteStopUnlock.test.ts b/tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-RemoteStopUnlock.test.ts index 56d2e609..f6b3c1f5 100644 --- a/tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-RemoteStopUnlock.test.ts +++ b/tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-RemoteStopUnlock.test.ts @@ -8,7 +8,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it, mock } from 'node:test' -import type { ChargingStation } from '../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../src/charging-station/index.js' import type { TestableOCPP16IncomingRequestService } from '../../../../src/charging-station/ocpp/1.6/__testable__/index.js' import type { GenericResponse, RemoteStopTransactionRequest } from '../../../../src/types/index.js' diff --git a/tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-Reservation.test.ts b/tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-Reservation.test.ts index 44b2b044..9c0a3a2f 100644 --- a/tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-Reservation.test.ts +++ b/tests/charging-station/ocpp/1.6/OCPP16IncomingRequestService-Reservation.test.ts @@ -7,7 +7,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../src/charging-station/index.js' import type { OCPP16CancelReservationRequest, OCPP16ReserveNowRequest, diff --git a/tests/charging-station/ocpp/1.6/OCPP16Integration-Reservations.test.ts b/tests/charging-station/ocpp/1.6/OCPP16Integration-Reservations.test.ts index 19f2952f..7f33970f 100644 --- a/tests/charging-station/ocpp/1.6/OCPP16Integration-Reservations.test.ts +++ b/tests/charging-station/ocpp/1.6/OCPP16Integration-Reservations.test.ts @@ -8,7 +8,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../src/charging-station/index.js' import type { OCPP16CancelReservationRequest, OCPP16ReserveNowRequest, diff --git a/tests/charging-station/ocpp/1.6/OCPP16Integration-Transactions.test.ts b/tests/charging-station/ocpp/1.6/OCPP16Integration-Transactions.test.ts index 9b9e5d0d..63cff80e 100644 --- a/tests/charging-station/ocpp/1.6/OCPP16Integration-Transactions.test.ts +++ b/tests/charging-station/ocpp/1.6/OCPP16Integration-Transactions.test.ts @@ -9,7 +9,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../src/charging-station/index.js' import type { TestableOCPP16IncomingRequestService } from '../../../../src/charging-station/ocpp/1.6/__testable__/index.js' import type { OCPP16ResponseService } from '../../../../src/charging-station/ocpp/1.6/OCPP16ResponseService.js' import type { diff --git a/tests/charging-station/ocpp/1.6/OCPP16ResponseService-Transactions.test.ts b/tests/charging-station/ocpp/1.6/OCPP16ResponseService-Transactions.test.ts index f87d80dd..45da1961 100644 --- a/tests/charging-station/ocpp/1.6/OCPP16ResponseService-Transactions.test.ts +++ b/tests/charging-station/ocpp/1.6/OCPP16ResponseService-Transactions.test.ts @@ -8,7 +8,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../src/charging-station/index.js' import type { OCPP16ResponseService } from '../../../../src/charging-station/ocpp/1.6/OCPP16ResponseService.js' import type { OCPP16StartTransactionRequest, diff --git a/tests/charging-station/ocpp/1.6/OCPP16TestUtils.ts b/tests/charging-station/ocpp/1.6/OCPP16TestUtils.ts index b456dff6..9cbc5a75 100644 --- a/tests/charging-station/ocpp/1.6/OCPP16TestUtils.ts +++ b/tests/charging-station/ocpp/1.6/OCPP16TestUtils.ts @@ -6,9 +6,8 @@ import { mock } from 'node:test' -import type { ChargingStation } from '../../../../src/charging-station/ChargingStation.js' -import type { ChargingStationInfo } from '../../../../src/types/ChargingStationInfo.js' -import type { ConfigurationKey } from '../../../../src/types/ChargingStationOcppConfiguration.js' +import type { ChargingStation } from '../../../../src/charging-station/index.js' +import type { ChargingStationInfo, ConfigurationKey } from '../../../../src/types/index.js' import type { IncomingRequestCommand, OCPP16ChargingProfile, @@ -16,8 +15,7 @@ import type { OCPP16SampledValue, RequestCommand, } from '../../../../src/types/index.js' -import type { JsonObject } from '../../../../src/types/JsonType.js' -import type { SampledValueTemplate } from '../../../../src/types/MeasurandPerPhaseSampledValueTemplates.js' +import type { JsonObject, SampledValueTemplate } from '../../../../src/types/index.js' import { createTestableIncomingRequestService, diff --git a/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-RemoteStartAuth.test.ts b/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-RemoteStartAuth.test.ts index 97c3f347..8df12ffa 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-RemoteStartAuth.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-RemoteStartAuth.test.ts @@ -6,8 +6,8 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../../../src/charging-station/ChargingStation.js' -import type { ConnectorStatus } from '../../../../src/types/ConnectorStatus.js' +import type { ChargingStation } from '../../../../src/charging-station/index.js' +import type { ConnectorStatus } from '../../../../src/types/index.js' import { OCPP20IncomingRequestService } from '../../../../src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.js' import { diff --git a/tests/charging-station/ocpp/2.0/OCPP20ResponseService-TransactionEvent.test.ts b/tests/charging-station/ocpp/2.0/OCPP20ResponseService-TransactionEvent.test.ts index 2ccc4b04..492fa105 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20ResponseService-TransactionEvent.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20ResponseService-TransactionEvent.test.ts @@ -12,7 +12,7 @@ import type { OCPP20TransactionEventRequest, OCPP20TransactionEventResponse, } from '../../../../src/types/index.js' -import type { UUIDv4 } from '../../../../src/types/UUID.js' +import type { UUIDv4 } from '../../../../src/types/index.js' import { OCPP20ResponseService } from '../../../../src/charging-station/ocpp/2.0/OCPP20ResponseService.js' import { OCPP20ServiceUtils } from '../../../../src/charging-station/ocpp/2.0/OCPP20ServiceUtils.js' diff --git a/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-TransactionEvent.test.ts b/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-TransactionEvent.test.ts index e54e8f94..2db7c17a 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-TransactionEvent.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-TransactionEvent.test.ts @@ -13,7 +13,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it, mock } from 'node:test' -import type { ChargingStation } from '../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../src/charging-station/index.js' import type { EmptyObject } from '../../../../src/types/index.js' import { diff --git a/tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts b/tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts index 4f856429..72529a7e 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20TestUtils.ts @@ -4,13 +4,13 @@ */ import { mock } from 'node:test' -import type { ChargingStation } from '../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../src/charging-station/index.js' import type { ChargingStationWithCertificateManager } from '../../../../src/charging-station/ocpp/2.0/OCPP20CertificateManager.js' -import type { ConfigurationKey } from '../../../../src/types/ChargingStationOcppConfiguration.js' -import type { EmptyObject } from '../../../../src/types/EmptyObject.js' import type { CertificateHashDataChainType, CertificateHashDataType, + ConfigurationKey, + EmptyObject, GetCertificateIdUseEnumType, JsonType, OCPP20IdTokenType, diff --git a/tests/charging-station/ocpp/2.0/OCPP20VariableManager.test.ts b/tests/charging-station/ocpp/2.0/OCPP20VariableManager.test.ts index 0b8fb228..e85094ec 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20VariableManager.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20VariableManager.test.ts @@ -7,7 +7,7 @@ import { millisecondsToSeconds } from 'date-fns' import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../src/charging-station/index.js' import { deleteConfigurationKey, diff --git a/tests/charging-station/ocpp/OCPPServiceUtils-connectorStatus.test.ts b/tests/charging-station/ocpp/OCPPServiceUtils-connectorStatus.test.ts index 27e92439..b196e5d5 100644 --- a/tests/charging-station/ocpp/OCPPServiceUtils-connectorStatus.test.ts +++ b/tests/charging-station/ocpp/OCPPServiceUtils-connectorStatus.test.ts @@ -10,7 +10,7 @@ import assert from 'node:assert/strict' import { afterEach, describe, it, mock } from 'node:test' -import type { ChargingStation } from '../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../src/charging-station/index.js' import type { Reservation } from '../../../src/types/index.js' import type { MockChargingStationOptions } from '../helpers/StationHelpers.js' diff --git a/tests/charging-station/ocpp/OCPPServiceUtils-pure.test.ts b/tests/charging-station/ocpp/OCPPServiceUtils-pure.test.ts index ac097306..f74b6c09 100644 --- a/tests/charging-station/ocpp/OCPPServiceUtils-pure.test.ts +++ b/tests/charging-station/ocpp/OCPPServiceUtils-pure.test.ts @@ -14,7 +14,7 @@ import type { ErrorObject } from 'ajv' import assert from 'node:assert/strict' import { afterEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../src/charging-station/index.js' import { ajvErrorsToErrorType, diff --git a/tests/charging-station/ocpp/OCPPServiceUtils-validation.test.ts b/tests/charging-station/ocpp/OCPPServiceUtils-validation.test.ts index 5ecc8d35..c2c15570 100644 --- a/tests/charging-station/ocpp/OCPPServiceUtils-validation.test.ts +++ b/tests/charging-station/ocpp/OCPPServiceUtils-validation.test.ts @@ -12,7 +12,7 @@ import assert from 'node:assert/strict' import { afterEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../src/charging-station/index.js' import { OCPPServiceUtils } from '../../../src/charging-station/ocpp/OCPPServiceUtils.js' import { IncomingRequestCommand, MessageTrigger, RequestCommand } from '../../../src/types/index.js' diff --git a/tests/charging-station/ocpp/auth/OCPPAuthIntegration.test.ts b/tests/charging-station/ocpp/auth/OCPPAuthIntegration.test.ts index ae45818f..4c3ed7d6 100644 --- a/tests/charging-station/ocpp/auth/OCPPAuthIntegration.test.ts +++ b/tests/charging-station/ocpp/auth/OCPPAuthIntegration.test.ts @@ -6,7 +6,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../src/charging-station/index.js' import type { LocalAuthEntry } from '../../../../src/charging-station/ocpp/auth/interfaces/OCPPAuthService.js' import { InMemoryAuthCache } from '../../../../src/charging-station/ocpp/auth/cache/InMemoryAuthCache.js' diff --git a/tests/charging-station/ocpp/auth/adapters/OCPP16AuthAdapter.test.ts b/tests/charging-station/ocpp/auth/adapters/OCPP16AuthAdapter.test.ts index be453597..b7f22f2a 100644 --- a/tests/charging-station/ocpp/auth/adapters/OCPP16AuthAdapter.test.ts +++ b/tests/charging-station/ocpp/auth/adapters/OCPP16AuthAdapter.test.ts @@ -5,7 +5,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../../src/charging-station/index.js' import type { OCPP16AuthorizeResponse } from '../../../../../src/types/index.js' import { OCPP16AuthAdapter } from '../../../../../src/charging-station/ocpp/auth/adapters/OCPP16AuthAdapter.js' diff --git a/tests/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.test.ts b/tests/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.test.ts index 1619637c..3805b2f3 100644 --- a/tests/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.test.ts +++ b/tests/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.test.ts @@ -5,7 +5,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it, mock } from 'node:test' -import type { ChargingStation } from '../../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../../src/charging-station/index.js' import { OCPP20ServiceUtils } from '../../../../../src/charging-station/ocpp/2.0/OCPP20ServiceUtils.js' import { OCPP20AuthAdapter } from '../../../../../src/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.js' diff --git a/tests/charging-station/ocpp/auth/helpers/MockFactories.ts b/tests/charging-station/ocpp/auth/helpers/MockFactories.ts index 1a100b58..ebf53db3 100644 --- a/tests/charging-station/ocpp/auth/helpers/MockFactories.ts +++ b/tests/charging-station/ocpp/auth/helpers/MockFactories.ts @@ -4,7 +4,7 @@ */ import assert from 'node:assert/strict' -import type { ChargingStation } from '../../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../../src/charging-station/index.js' import type { AuthCache, LocalAuthEntry, diff --git a/tests/charging-station/ocpp/auth/services/OCPPAuthServiceFactory.test.ts b/tests/charging-station/ocpp/auth/services/OCPPAuthServiceFactory.test.ts index 645a7292..93ca23e7 100644 --- a/tests/charging-station/ocpp/auth/services/OCPPAuthServiceFactory.test.ts +++ b/tests/charging-station/ocpp/auth/services/OCPPAuthServiceFactory.test.ts @@ -5,7 +5,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../../src/charging-station/index.js' import { OCPPAuthServiceFactory } from '../../../../../src/charging-station/ocpp/auth/services/OCPPAuthServiceFactory.js' import { OCPPVersion } from '../../../../../src/types/index.js' diff --git a/tests/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.test.ts b/tests/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.test.ts index 5285371b..b3ec2464 100644 --- a/tests/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.test.ts +++ b/tests/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.test.ts @@ -5,7 +5,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../../src/charging-station/index.js' import type { OCPPAuthService } from '../../../../../src/charging-station/ocpp/auth/interfaces/OCPPAuthService.js' import { OCPPAuthServiceImpl } from '../../../../../src/charging-station/ocpp/auth/services/OCPPAuthServiceImpl.js' diff --git a/tests/charging-station/ocpp/auth/strategies/CertificateAuthStrategy.test.ts b/tests/charging-station/ocpp/auth/strategies/CertificateAuthStrategy.test.ts index 40258482..b45da9a2 100644 --- a/tests/charging-station/ocpp/auth/strategies/CertificateAuthStrategy.test.ts +++ b/tests/charging-station/ocpp/auth/strategies/CertificateAuthStrategy.test.ts @@ -5,7 +5,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../../../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../../../../src/charging-station/index.js' import type { OCPPAuthAdapter } from '../../../../../src/charging-station/ocpp/auth/interfaces/OCPPAuthService.js' import { CertificateAuthStrategy } from '../../../../../src/charging-station/ocpp/auth/strategies/CertificateAuthStrategy.js' diff --git a/tests/exception/OCPPError.test.ts b/tests/exception/OCPPError.test.ts index 4c97b2dc..a3b8cdad 100644 --- a/tests/exception/OCPPError.test.ts +++ b/tests/exception/OCPPError.test.ts @@ -8,7 +8,7 @@ import { afterEach, describe, it } from 'node:test' import { BaseError } from '../../src/exception/BaseError.js' import { OCPPError } from '../../src/exception/OCPPError.js' import { ErrorType, RequestCommand } from '../../src/types/index.js' -import { Constants } from '../../src/utils/Constants.js' +import { Constants } from '../../src/utils/index.js' import { standardCleanup } from '../helpers/TestLifecycleHelpers.js' await describe('OCPPError', async () => { diff --git a/tests/helpers/OCPPAuthIntegrationTest.ts b/tests/helpers/OCPPAuthIntegrationTest.ts index 0f0b3852..e2afb749 100644 --- a/tests/helpers/OCPPAuthIntegrationTest.ts +++ b/tests/helpers/OCPPAuthIntegrationTest.ts @@ -1,4 +1,4 @@ -import type { ChargingStation } from '../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../src/charging-station/index.js' import type { AuthConfiguration, AuthorizationResult, @@ -14,7 +14,7 @@ import { IdentifierType, } from '../../src/charging-station/ocpp/auth/types/AuthTypes.js' import { OCPPVersion } from '../../src/types/index.js' -import { logger } from '../../src/utils/Logger.js' +import { logger } from '../../src/utils/index.js' export class OCPPAuthIntegrationTest { private authService: OCPPAuthServiceImpl diff --git a/tests/helpers/TestLifecycleHelpers.ts b/tests/helpers/TestLifecycleHelpers.ts index 883c0639..85102971 100644 --- a/tests/helpers/TestLifecycleHelpers.ts +++ b/tests/helpers/TestLifecycleHelpers.ts @@ -27,7 +27,7 @@ import { mock } from 'node:test' -import type { ChargingStation } from '../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../src/charging-station/index.js' import { MockIdTagsCache, MockSharedLRUCache } from '../charging-station/mocks/MockCaches.js' diff --git a/tests/performance/storage/MikroOrmStorage.test.ts b/tests/performance/storage/MikroOrmStorage.test.ts index 494d070e..5a0fc6d2 100644 --- a/tests/performance/storage/MikroOrmStorage.test.ts +++ b/tests/performance/storage/MikroOrmStorage.test.ts @@ -10,8 +10,7 @@ import { afterEach, beforeEach, describe, it } from 'node:test' import { MikroOrmStorage } from '../../../src/performance/storage/MikroOrmStorage.js' import { StorageType } from '../../../src/types/index.js' import { PerformanceRecord } from '../../../src/types/orm/entities/PerformanceRecord.js' -import { Constants } from '../../../src/utils/index.js' -import { logger } from '../../../src/utils/Logger.js' +import { Constants, logger } from '../../../src/utils/index.js' import { standardCleanup } from '../../helpers/TestLifecycleHelpers.js' import { buildTestStatistics } from './StorageTestHelpers.js' diff --git a/tests/performance/storage/MongoDBStorage.test.ts b/tests/performance/storage/MongoDBStorage.test.ts index c65bdfd5..d365fce7 100644 --- a/tests/performance/storage/MongoDBStorage.test.ts +++ b/tests/performance/storage/MongoDBStorage.test.ts @@ -6,8 +6,7 @@ import assert from 'node:assert/strict' import { afterEach, beforeEach, describe, it } from 'node:test' import { MongoDBStorage } from '../../../src/performance/storage/MongoDBStorage.js' -import { Constants } from '../../../src/utils/index.js' -import { logger } from '../../../src/utils/Logger.js' +import { Constants, logger } from '../../../src/utils/index.js' import { standardCleanup } from '../../helpers/TestLifecycleHelpers.js' import { buildTestStatistics } from './StorageTestHelpers.js' diff --git a/tests/utils/ChargingStationConfigurationUtils.test.ts b/tests/utils/ChargingStationConfigurationUtils.test.ts index b3d6bafa..aa32c7c0 100644 --- a/tests/utils/ChargingStationConfigurationUtils.test.ts +++ b/tests/utils/ChargingStationConfigurationUtils.test.ts @@ -8,7 +8,7 @@ import assert from 'node:assert/strict' import { afterEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../src/charging-station/index.js' import type { ConnectorStatus, EvseStatus } from '../../src/types/index.js' import { AvailabilityType } from '../../src/types/index.js' diff --git a/tests/utils/Configuration.test.ts b/tests/utils/Configuration.test.ts index 281278e6..4917bd5a 100644 --- a/tests/utils/Configuration.test.ts +++ b/tests/utils/Configuration.test.ts @@ -29,7 +29,7 @@ import { SupervisionUrlDistribution, } from '../../src/types/index.js' import { Configuration } from '../../src/utils/index.js' -import { WorkerProcessType } from '../../src/worker/WorkerTypes.js' +import { WorkerProcessType } from '../../src/worker/index.js' import { standardCleanup } from '../helpers/TestLifecycleHelpers.js' /** diff --git a/tests/utils/ErrorUtils.test.ts b/tests/utils/ErrorUtils.test.ts index 8976c3d8..efd50a59 100644 --- a/tests/utils/ErrorUtils.test.ts +++ b/tests/utils/ErrorUtils.test.ts @@ -6,7 +6,7 @@ import assert from 'node:assert/strict' import process from 'node:process' import { afterEach, beforeEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../src/charging-station/index.js' import { FileType, @@ -22,7 +22,7 @@ import { handleUncaughtException, handleUnhandledRejection, } from '../../src/utils/ErrorUtils.js' -import { logger } from '../../src/utils/Logger.js' +import { logger } from '../../src/utils/index.js' import { TEST_CHARGING_STATION_BASE_NAME } from '../charging-station/ChargingStationTestConstants.js' import { createMockChargingStation } from '../charging-station/ChargingStationTestUtils.js' import { diff --git a/tests/utils/FileUtils.test.ts b/tests/utils/FileUtils.test.ts index ef9eb051..519d95c2 100644 --- a/tests/utils/FileUtils.test.ts +++ b/tests/utils/FileUtils.test.ts @@ -10,7 +10,7 @@ import { afterEach, describe, it } from 'node:test' import { FileType } from '../../src/types/index.js' import { watchJsonFile } from '../../src/utils/FileUtils.js' -import { logger } from '../../src/utils/Logger.js' +import { logger } from '../../src/utils/index.js' import { createLoggerMocks, standardCleanup } from '../helpers/TestLifecycleHelpers.js' const noop: WatchListener = () => { diff --git a/tests/utils/MessageChannelUtils.test.ts b/tests/utils/MessageChannelUtils.test.ts index 480f29c7..293fec2f 100644 --- a/tests/utils/MessageChannelUtils.test.ts +++ b/tests/utils/MessageChannelUtils.test.ts @@ -7,7 +7,7 @@ import { CircularBuffer } from 'mnemonist' import assert from 'node:assert/strict' import { afterEach, describe, it } from 'node:test' -import type { ChargingStation } from '../../src/charging-station/ChargingStation.js' +import type { ChargingStation } from '../../src/charging-station/index.js' import type { Statistics, TimestampedData } from '../../src/types/index.js' import { ChargingStationWorkerMessageEvents } from '../../src/types/index.js' diff --git a/tests/utils/Utils.test.ts b/tests/utils/Utils.test.ts index 38cc4778..eda6abb6 100644 --- a/tests/utils/Utils.test.ts +++ b/tests/utils/Utils.test.ts @@ -16,7 +16,7 @@ import type { TimestampedData } from '../../src/types/index.js' import { JSRuntime, runtime } from '../../scripts/runtime.js' import { MapStringifyFormat } from '../../src/types/index.js' -import { Constants } from '../../src/utils/Constants.js' +import { Constants } from '../../src/utils/index.js' import { clampToSafeTimerValue, clone, -- 2.43.0