From f5d6dd4e457e79d88474f86c987af3bc1876d2bf Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 7 Apr 2026 21:07:33 +0200 Subject: [PATCH] refactor(tests): harmonize test file names and @file descriptions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - Rename test files to follow Source-Focus.test.ts convention: OCPP16SignedMeterValues → OCPP16ServiceUtils-SignedMeterValues OCPP20SignedMeterValues → OCPP20RequestBuilders-SignedMeterValues OCPP16SchemaValidation → OCPP16ServiceUtils-SchemaValidation OCPP20SchemaValidation → OCPP20IncomingRequestService-SchemaValidation OCPP16VendorParametersKey → Configuration (in tests/types/) - Harmonize all @file tags to 'Tests for [focus]' pattern - Fix module name mismatches, dot notation, and inverted descriptions - Integration tests use descriptive 'Tests for OCPP X.Y ' style --- tests/charging-station/ChargingStation.test.ts | 2 +- .../ocpp/1.6/OCPP16Integration-ChargingProfiles.test.ts | 2 +- .../ocpp/1.6/OCPP16Integration-Configuration.test.ts | 2 +- .../ocpp/1.6/OCPP16Integration-Transactions.test.ts | 2 +- .../ocpp/1.6/OCPP16RequestService-CallChain.test.ts | 2 +- ...on.test.ts => OCPP16ServiceUtils-SchemaValidation.test.ts} | 2 +- ...s.test.ts => OCPP16ServiceUtils-SignedMeterValues.test.ts} | 2 +- .../ocpp/2.0/OCPP20IncomingRequestService-GroupIdStop.test.ts | 2 +- ... => OCPP20IncomingRequestService-SchemaValidation.test.ts} | 2 +- tests/charging-station/ocpp/2.0/OCPP20Integration.test.ts | 2 +- ...est.ts => OCPP20RequestBuilders-SignedMeterValues.test.ts} | 2 +- .../ocpp/2.0/OCPP20RequestService-CallChain.test.ts | 2 +- .../ocpp/2.0/OCPP20ResponseService-CacheUpdate.test.ts | 2 +- .../ocpp/2.0/OCPP20ServiceUtils-AuthCache.test.ts | 2 +- .../ocpp/2.0/OCPP20ServiceUtils-ReconnectDelay.test.ts | 2 +- .../ocpp/2.0/OCPP20ServiceUtils-enforceMessageLimits.test.ts | 2 +- .../ocpp/OCPPSignedMeterDataGenerator.test.ts | 2 +- tests/charging-station/ocpp/OCPPSignedMeterValueUtils.test.ts | 2 +- .../ui-server/UIMCPServer.integration.test.ts | 2 +- tests/types/ocpp/1.6/Configuration.test.ts | 4 ++-- tests/types/ocpp/1.6/MeterValues.test.ts | 2 +- tests/utils/Configuration.test.ts | 2 +- 22 files changed, 23 insertions(+), 23 deletions(-) rename tests/charging-station/ocpp/1.6/{OCPP16SchemaValidation.test.ts => OCPP16ServiceUtils-SchemaValidation.test.ts} (99%) rename tests/charging-station/ocpp/1.6/{OCPP16SignedMeterValues.test.ts => OCPP16ServiceUtils-SignedMeterValues.test.ts} (99%) rename tests/charging-station/ocpp/2.0/{OCPP20SchemaValidation.test.ts => OCPP20IncomingRequestService-SchemaValidation.test.ts} (99%) rename tests/charging-station/ocpp/2.0/{OCPP20SignedMeterValues.test.ts => OCPP20RequestBuilders-SignedMeterValues.test.ts} (99%) diff --git a/tests/charging-station/ChargingStation.test.ts b/tests/charging-station/ChargingStation.test.ts index c456c864..023ab14e 100644 --- a/tests/charging-station/ChargingStation.test.ts +++ b/tests/charging-station/ChargingStation.test.ts @@ -1,5 +1,5 @@ /** - * @file ChargingStation Integration Tests + * @file Tests for ChargingStation integration * @description Integration test suite that verifies all ChargingStation test modules work together. * * Related domain-specific test files: diff --git a/tests/charging-station/ocpp/1.6/OCPP16Integration-ChargingProfiles.test.ts b/tests/charging-station/ocpp/1.6/OCPP16Integration-ChargingProfiles.test.ts index ad3eef64..c4655c35 100644 --- a/tests/charging-station/ocpp/1.6/OCPP16Integration-ChargingProfiles.test.ts +++ b/tests/charging-station/ocpp/1.6/OCPP16Integration-ChargingProfiles.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for OCPP 1.6 Charging Profile Management — Integration + * @file Tests for OCPP 1.6 Charging Profile Management integration * @see OCPP 1.6 — §9.3 SetChargingProfile, §9.1 ClearChargingProfile, §9.2 GetCompositeSchedule * @description Multi-step integration tests verifying roundtrip flows across SetChargingProfile, * ClearChargingProfile, and GetCompositeSchedule handlers for OCPP 1.6 Smart Charging diff --git a/tests/charging-station/ocpp/1.6/OCPP16Integration-Configuration.test.ts b/tests/charging-station/ocpp/1.6/OCPP16Integration-Configuration.test.ts index a2d76894..60275e8b 100644 --- a/tests/charging-station/ocpp/1.6/OCPP16Integration-Configuration.test.ts +++ b/tests/charging-station/ocpp/1.6/OCPP16Integration-Configuration.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for OCPP16 Integration — Configuration Management + * @file Tests for OCPP 1.6 Configuration Management integration * @see OCPP 1.6 — §5.4 ChangeConfiguration, §5.8 GetConfiguration * @description Multi-step integration tests verifying ChangeConfiguration → GetConfiguration * roundtrips for OCPP 1.6 configuration management flows 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 93903de9..aace2bbb 100644 --- a/tests/charging-station/ocpp/1.6/OCPP16Integration-Transactions.test.ts +++ b/tests/charging-station/ocpp/1.6/OCPP16Integration-Transactions.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for OCPP 1.6 integration — Transaction lifecycle + * @file Tests for OCPP 1.6 Transaction lifecycle integration * @module OCPP 1.6 — §5.11 RemoteStartTransaction, §5.12 RemoteStopTransaction, * §5.14 StartTransaction (response), §5.16 StopTransaction (response) * @description Multi-step integration tests crossing IncomingRequestService, RequestService, diff --git a/tests/charging-station/ocpp/1.6/OCPP16RequestService-CallChain.test.ts b/tests/charging-station/ocpp/1.6/OCPP16RequestService-CallChain.test.ts index defd32ee..9d724e1f 100644 --- a/tests/charging-station/ocpp/1.6/OCPP16RequestService-CallChain.test.ts +++ b/tests/charging-station/ocpp/1.6/OCPP16RequestService-CallChain.test.ts @@ -1,5 +1,5 @@ /** - * @file Call chain integration tests for OCPP 1.6 request pipeline + * @file Tests for OCPP16RequestService call chain integration * @description Verifies that requestHandler → buildRequestPayload → sendMessage * is the single path for all outgoing requests. */ diff --git a/tests/charging-station/ocpp/1.6/OCPP16SchemaValidation.test.ts b/tests/charging-station/ocpp/1.6/OCPP16ServiceUtils-SchemaValidation.test.ts similarity index 99% rename from tests/charging-station/ocpp/1.6/OCPP16SchemaValidation.test.ts rename to tests/charging-station/ocpp/1.6/OCPP16ServiceUtils-SchemaValidation.test.ts index afbecfcb..39aa1db0 100644 --- a/tests/charging-station/ocpp/1.6/OCPP16SchemaValidation.test.ts +++ b/tests/charging-station/ocpp/1.6/OCPP16ServiceUtils-SchemaValidation.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for OCPP 1.6 JSON schema validation + * @file Tests for OCPP16ServiceUtils JSON schema validation * @module OCPP 1.6 — §4.1 BootNotification, §5.11 RemoteStartTransaction, §9.3 SetChargingProfile, * §5.13 Reset, §5.3 ChangeAvailability (representative schema coverage) * @description Verifies that OCPP 1.6 JSON schemas correctly validate and reject payloads diff --git a/tests/charging-station/ocpp/1.6/OCPP16SignedMeterValues.test.ts b/tests/charging-station/ocpp/1.6/OCPP16ServiceUtils-SignedMeterValues.test.ts similarity index 99% rename from tests/charging-station/ocpp/1.6/OCPP16SignedMeterValues.test.ts rename to tests/charging-station/ocpp/1.6/OCPP16ServiceUtils-SignedMeterValues.test.ts index 88a11438..22620b32 100644 --- a/tests/charging-station/ocpp/1.6/OCPP16SignedMeterValues.test.ts +++ b/tests/charging-station/ocpp/1.6/OCPP16ServiceUtils-SignedMeterValues.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for OCPP 1.6 signed meter value support + * @file Tests for OCPP16ServiceUtils signed meter value support * @module OCPP 1.6 — Signed MeterValues (OCA Application Note v1.0) * @description Verifies signed meter value integration in transaction begin/end functions, * buildSignedOCPP16SampledValue, and periodic meter values. diff --git a/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-GroupIdStop.test.ts b/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-GroupIdStop.test.ts index 621790b6..87292ce4 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-GroupIdStop.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-GroupIdStop.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for OCPP 2.0 GroupId-based stop transaction authorization + * @file Tests for OCPP20IncomingRequestService GroupId-based stop transaction * @description Unit tests for C01.FR.03, C09.FR.03, C09.FR.07 conformance */ diff --git a/tests/charging-station/ocpp/2.0/OCPP20SchemaValidation.test.ts b/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-SchemaValidation.test.ts similarity index 99% rename from tests/charging-station/ocpp/2.0/OCPP20SchemaValidation.test.ts rename to tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-SchemaValidation.test.ts index 58f6ef23..e60eb6fe 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20SchemaValidation.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20IncomingRequestService-SchemaValidation.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for OCPP 2.0 JSON schema validation (negative tests) + * @file Tests for OCPP20IncomingRequestService JSON schema validation (negative tests) * @description Verifies that OCPP 2.0.1 JSON schemas correctly reject invalid payloads * when compiled with AJV. Tests the schemas directly (not through service plumbing), * which ensures correctness regardless of path resolution in tsx/dist modes. diff --git a/tests/charging-station/ocpp/2.0/OCPP20Integration.test.ts b/tests/charging-station/ocpp/2.0/OCPP20Integration.test.ts index 892ea862..c60c63a2 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20Integration.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20Integration.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for OCPP 2.0 integration (SetVariables → GetVariables consistency) + * @file Tests for OCPP 2.0 integration * @description Verifies that SetVariables and GetVariables produce consistent results */ diff --git a/tests/charging-station/ocpp/2.0/OCPP20SignedMeterValues.test.ts b/tests/charging-station/ocpp/2.0/OCPP20RequestBuilders-SignedMeterValues.test.ts similarity index 99% rename from tests/charging-station/ocpp/2.0/OCPP20SignedMeterValues.test.ts rename to tests/charging-station/ocpp/2.0/OCPP20RequestBuilders-SignedMeterValues.test.ts index 0013ed6b..08ceddd4 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20SignedMeterValues.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20RequestBuilders-SignedMeterValues.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for OCPP 2.0 signed meter value support + * @file Tests for OCPP20RequestBuilders signed meter value support * @description Verifies signedMeterValue population in sampled value building, * context-dependent sub-switch logic, and public key inclusion. */ diff --git a/tests/charging-station/ocpp/2.0/OCPP20RequestService-CallChain.test.ts b/tests/charging-station/ocpp/2.0/OCPP20RequestService-CallChain.test.ts index ee4c618c..1d61794f 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20RequestService-CallChain.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20RequestService-CallChain.test.ts @@ -1,5 +1,5 @@ /** - * @file Call chain integration tests for OCPP 2.0 request pipeline + * @file Tests for OCPP20RequestService call chain integration * @description Verifies that requestHandler → buildRequestPayload → sendMessage * is the single path for all outgoing requests. Minimal params in, complete * spec-compliant payload in sendMessage. diff --git a/tests/charging-station/ocpp/2.0/OCPP20ResponseService-CacheUpdate.test.ts b/tests/charging-station/ocpp/2.0/OCPP20ResponseService-CacheUpdate.test.ts index b07202c3..b4d7cf22 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20ResponseService-CacheUpdate.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20ResponseService-CacheUpdate.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for OCPPAuthServiceImpl.updateCacheEntry + * @file Tests for OCPP20ResponseService cache update * @description Unit tests for auth cache updates per OCPP 2.0.1 * C10.FR.01/05, C12.FR.06, C02.FR.03, C03.FR.02 */ diff --git a/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-AuthCache.test.ts b/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-AuthCache.test.ts index d815f6d9..bd88541b 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-AuthCache.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-AuthCache.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for OCPP20ServiceUtils.updateAuthorizationCache + * @file Tests for OCPP20ServiceUtils authorization cache * @description Verifies the static helper that delegates auth cache updates to OCPPAuthService, * covering the C10.FR.04 AuthorizeResponse path and graceful error handling. */ diff --git a/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-ReconnectDelay.test.ts b/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-ReconnectDelay.test.ts index 890691e7..0b85e221 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-ReconnectDelay.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-ReconnectDelay.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for OCPP20ServiceUtils.computeReconnectDelay + * @file Tests for OCPP20ServiceUtils reconnect delay computation * @description Verifies OCPP 2.0.1 §8.1-§8.3 RetryBackOff reconnection delay computation, * including default values, variable-configured values, and retry capping. */ diff --git a/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-enforceMessageLimits.test.ts b/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-enforceMessageLimits.test.ts index 3d4cd911..d569b195 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-enforceMessageLimits.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-enforceMessageLimits.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for OCPP20ServiceUtils.enforceMessageLimits + * @file Tests for OCPP20ServiceUtils message limits enforcement * @description Verifies message limit enforcement logic for OCPP 2.0 payloads */ diff --git a/tests/charging-station/ocpp/OCPPSignedMeterDataGenerator.test.ts b/tests/charging-station/ocpp/OCPPSignedMeterDataGenerator.test.ts index d7c7852a..ad0309d3 100644 --- a/tests/charging-station/ocpp/OCPPSignedMeterDataGenerator.test.ts +++ b/tests/charging-station/ocpp/OCPPSignedMeterDataGenerator.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for SignedMeterDataGenerator + * @file Tests for OCPPSignedMeterDataGenerator * @description Verifies OCMF-like signed meter data generation for simulation purposes. * * Covers: diff --git a/tests/charging-station/ocpp/OCPPSignedMeterValueUtils.test.ts b/tests/charging-station/ocpp/OCPPSignedMeterValueUtils.test.ts index 5ebb0a7b..eead34cf 100644 --- a/tests/charging-station/ocpp/OCPPSignedMeterValueUtils.test.ts +++ b/tests/charging-station/ocpp/OCPPSignedMeterValueUtils.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for SignedMeterValueUtils + * @file Tests for OCPPSignedMeterValueUtils * @description Unit tests for PublicKeyWithSignedMeterValueEnumType and shouldIncludePublicKey helper */ import assert from 'node:assert/strict' diff --git a/tests/charging-station/ui-server/UIMCPServer.integration.test.ts b/tests/charging-station/ui-server/UIMCPServer.integration.test.ts index 63493472..881dec9c 100644 --- a/tests/charging-station/ui-server/UIMCPServer.integration.test.ts +++ b/tests/charging-station/ui-server/UIMCPServer.integration.test.ts @@ -1,5 +1,5 @@ /** - * @file UIMCPServer Integration Tests + * @file Tests for UIMCPServer integration * @description HTTP integration tests verifying MCP endpoint responds correctly */ diff --git a/tests/types/ocpp/1.6/Configuration.test.ts b/tests/types/ocpp/1.6/Configuration.test.ts index 5bebf2ea..930dc643 100644 --- a/tests/types/ocpp/1.6/Configuration.test.ts +++ b/tests/types/ocpp/1.6/Configuration.test.ts @@ -1,6 +1,6 @@ /** - * @file Tests for OCPP16VendorParametersKey enum - * @description Unit tests for signed meter values vendor configuration keys + * @file Tests for OCPP 1.6 Configuration types + * @description Unit tests for OCPP16VendorParametersKey enum values */ import assert from 'node:assert/strict' import { describe, it } from 'node:test' diff --git a/tests/types/ocpp/1.6/MeterValues.test.ts b/tests/types/ocpp/1.6/MeterValues.test.ts index 774ae39b..94027a79 100644 --- a/tests/types/ocpp/1.6/MeterValues.test.ts +++ b/tests/types/ocpp/1.6/MeterValues.test.ts @@ -1,5 +1,5 @@ /** - * @file OCPP 1.6 MeterValues types test suite + * @file Tests for OCPP 1.6 MeterValues types * @description Tests for OCPP16MeterValueFormat enum and OCPP16SignedMeterValue interface */ diff --git a/tests/utils/Configuration.test.ts b/tests/utils/Configuration.test.ts index 4917bd5a..67ff6c25 100644 --- a/tests/utils/Configuration.test.ts +++ b/tests/utils/Configuration.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for Configuration static class + * @file Tests for Configuration * @description Verifies configuration loading, section building, and deprecated key handling * * Covers: -- 2.43.0