From f7640876ebe2863aeaaaa1fbfdc22549d6ed485a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 5 Jul 2026 23:30:16 +0200 Subject: [PATCH] chore: harmonize test filenames to PascalCase concern suffix convention (#1955) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit chore: harmonize test filenames to PascalCase concern suffix convention Rename 9 test files whose naming violated the codebase's dominant `[-].test.ts` convention. 156/165 test files were already conformant; this PR closes the remaining gap. Renames (all via `git mv`, content unchanged): Casing/separator normalizations (7): - tests/utils/Configuration-hot-reload.test.ts → tests/utils/Configuration-HotReload.test.ts (kebab-case lowercase) - tests/utils/ConfigurationValidation-perf.test.ts → tests/utils/ConfigurationValidation-Perf.test.ts (lowercase) - tests/charging-station/ocpp/OCPPServiceUtils-pure.test.ts → tests/charging-station/ocpp/OCPPServiceUtils-Pure.test.ts (lowercase) - tests/charging-station/ocpp/OCPPServiceUtils-meterValues.test.ts → tests/charging-station/ocpp/OCPPServiceUtils-MeterValues.test.ts (camelCase) - tests/charging-station/ocpp/OCPPServiceUtils-validation.test.ts → tests/charging-station/ocpp/OCPPServiceUtils-Validation.test.ts (lowercase) - tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-enforceMessageLimits.test.ts → tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-EnforceMessageLimits.test.ts (camelCase) - tests/charging-station/ui-server/UIMCPServer.integration.test.ts → tests/charging-station/ui-server/UIMCPServer-Integration.test.ts (`.integration.` — sole `.` separator in the test tree; now aligned on the `-Integration` pattern used by 5 sibling integration tests) Aggregate-pattern alignment (1): - tests/charging-station/ocpp/1.6/OCPP16-CoherentMeterValues.test.ts → tests/charging-station/ocpp/1.6/OCPP16Integration-CoherentMeterValues.test.ts Sole use of `OCPP16-` (version-dash without Integration) in the entire test tree. The file's own `@file` header describes itself as an "Integration-style test", aligning it with the established `OCPP16Integration-` aggregate pattern used by 4 siblings (`-ChargingProfiles`, `-Configuration`, `-Reservations`, `-Transactions`). OCPP standard casing (1): - tests/charging-station/ocpp/2.0/OCPP20RequestService-HeartBeat.test.ts → tests/charging-station/ocpp/2.0/OCPP20RequestService-Heartbeat.test.ts Every other file in the 12-file `OCPP20RequestService-*` group uses the OCPP standard action spelling (`BootNotification`, `MeterValues`, `NotifyReport`, etc.). OCPP 2.0.1 spells the action `Heartbeat` (single word); the `HeartBeat` variant with a mid-word capital B was the sole outlier. Not renamed (accepted as legitimate cases): - OCPPAuthIntegration.test.ts — "Integration" fused into the concept name, no per-concern split. - OCPP20Integration.test.ts — aggregate test with no per-concern split. - CoherentMeterValues.test.ts (meter-values/) — PascalCase concept name for a multi-file subsystem, no casing violation. - StrategyDispatch.test.ts, UIMetricsEndpoint.test.ts — PascalCase concept/aggregate names, no casing violation. Content preserved verbatim in 8 of the 9 renamed files (case-only and separator renames via `git mv` two-step for macOS APFS case-insensitivity). The 9th file (`OCPP20RequestService-Heartbeat.test.ts`) had 8 internal `HeartBeat` references (JSDoc `@file`, 5 `it()` descriptions, 2 inline comments) updated to `Heartbeat` to match the OCPP 2.0.1 spec spelling — the same rationale that motivated the filename rename. Source code already uses `Heartbeat` consistently (`src/types/ocpp/2.0/Requests.ts: HEARTBEAT = 'Heartbeat'`). No consumer updates required: the only non-test references to the old filenames live in auto-regenerated caches (`.serena/cache`, `.hermes/evidence`, `.eslintcache`) which self-heal, and historical planning docs under `.omo/plans/` (frozen; not updated). Post-PR: 165/165 test files conformant to the codebase's dominant `[-].test.ts` / `Integration[-].test.ts` conventions. Quality gates: typecheck clean; the 9 renamed test files run 80/80 pass, 0 fail. Out of scope for this PR (documented for future work): - ui/web/tests/ has 7 outliers (Utils/Dialogs/Actions casing mismatch vs source dirs; Errors casing vs source file; SimpleComponents / ClassicComponents / SkinComponents aggregate names with no matching source entity). These live in a different workspace with its own convention (source-mirror casing per file role); a dedicated ui/web-scoped harmonization PR is warranted. - Helper file placement inconsistency (some in `helpers/`, some co-located with `.test.ts` files) and 5 competing suffixes (TestUtils/TestHelpers/TestConstants/TestData/Fixtures) — needs a documented convention in TEST_STYLE_GUIDE before rename PR. - `mocks/` vs `auth/helpers/` split for mocks (MockCaches/MockWebSocket in mocks/, MockFactories in auth/helpers/) — same follow-up. --- ...CPP16Integration-CoherentMeterValues.test.ts} | 0 ...ts => OCPP20RequestService-Heartbeat.test.ts} | 16 ++++++++-------- ...P20ServiceUtils-EnforceMessageLimits.test.ts} | 0 ...t.ts => OCPPServiceUtils-MeterValues.test.ts} | 0 ...ure.test.ts => OCPPServiceUtils-Pure.test.ts} | 0 ...st.ts => OCPPServiceUtils-Validation.test.ts} | 0 ...n.test.ts => UIMCPServer-Integration.test.ts} | 0 ...d.test.ts => Configuration-HotReload.test.ts} | 0 ...t.ts => ConfigurationValidation-Perf.test.ts} | 0 9 files changed, 8 insertions(+), 8 deletions(-) rename tests/charging-station/ocpp/1.6/{OCPP16-CoherentMeterValues.test.ts => OCPP16Integration-CoherentMeterValues.test.ts} (100%) rename tests/charging-station/ocpp/2.0/{OCPP20RequestService-HeartBeat.test.ts => OCPP20RequestService-Heartbeat.test.ts} (91%) rename tests/charging-station/ocpp/2.0/{OCPP20ServiceUtils-enforceMessageLimits.test.ts => OCPP20ServiceUtils-EnforceMessageLimits.test.ts} (100%) rename tests/charging-station/ocpp/{OCPPServiceUtils-meterValues.test.ts => OCPPServiceUtils-MeterValues.test.ts} (100%) rename tests/charging-station/ocpp/{OCPPServiceUtils-pure.test.ts => OCPPServiceUtils-Pure.test.ts} (100%) rename tests/charging-station/ocpp/{OCPPServiceUtils-validation.test.ts => OCPPServiceUtils-Validation.test.ts} (100%) rename tests/charging-station/ui-server/{UIMCPServer.integration.test.ts => UIMCPServer-Integration.test.ts} (100%) rename tests/utils/{Configuration-hot-reload.test.ts => Configuration-HotReload.test.ts} (100%) rename tests/utils/{ConfigurationValidation-perf.test.ts => ConfigurationValidation-Perf.test.ts} (100%) diff --git a/tests/charging-station/ocpp/1.6/OCPP16-CoherentMeterValues.test.ts b/tests/charging-station/ocpp/1.6/OCPP16Integration-CoherentMeterValues.test.ts similarity index 100% rename from tests/charging-station/ocpp/1.6/OCPP16-CoherentMeterValues.test.ts rename to tests/charging-station/ocpp/1.6/OCPP16Integration-CoherentMeterValues.test.ts diff --git a/tests/charging-station/ocpp/2.0/OCPP20RequestService-HeartBeat.test.ts b/tests/charging-station/ocpp/2.0/OCPP20RequestService-Heartbeat.test.ts similarity index 91% rename from tests/charging-station/ocpp/2.0/OCPP20RequestService-HeartBeat.test.ts rename to tests/charging-station/ocpp/2.0/OCPP20RequestService-Heartbeat.test.ts index d2e1fc74..eb5b7b8b 100644 --- a/tests/charging-station/ocpp/2.0/OCPP20RequestService-HeartBeat.test.ts +++ b/tests/charging-station/ocpp/2.0/OCPP20RequestService-Heartbeat.test.ts @@ -1,5 +1,5 @@ /** - * @file Tests for OCPP20RequestService HeartBeat + * @file Tests for OCPP20RequestService Heartbeat * @description Unit tests for OCPP 2.0 Heartbeat request building (G02) */ import assert from 'node:assert/strict' @@ -49,7 +49,7 @@ await describe('G02 - Heartbeat', async () => { }) // FR: G02.FR.01 - await it('should build HeartBeat request payload correctly with empty object', () => { + await it('should build Heartbeat request payload correctly with empty object', () => { const requestParams: OCPP20HeartbeatRequest = {} const payload = testableRequestService.buildRequestPayload( @@ -64,7 +64,7 @@ await describe('G02 - Heartbeat', async () => { }) // FR: G02.FR.02 - await it('should build HeartBeat request payload correctly without parameters', () => { + await it('should build Heartbeat request payload correctly without parameters', () => { // Test without passing any request parameters const payload = testableRequestService.buildRequestPayload( station, @@ -95,7 +95,7 @@ await describe('G02 - Heartbeat', async () => { }) // FR: G02.FR.04 - await it('should handle HeartBeat request consistently across multiple calls', () => { + await it('should handle Heartbeat request consistently across multiple calls', () => { const requestParams: OCPP20HeartbeatRequest = {} // Call buildRequestPayload multiple times to ensure consistency @@ -125,7 +125,7 @@ await describe('G02 - Heartbeat', async () => { }) // FR: G02.FR.05 - await it('should handle HeartBeat request with different charging station configurations', () => { + await it('should handle Heartbeat request with different charging station configurations', () => { const { station: alternativeChargingStation } = createMockChargingStation({ baseName: TEST_CHARGING_STATION_BASE_NAME, connectorsCount: 3, @@ -150,7 +150,7 @@ await describe('G02 - Heartbeat', async () => { requestParams ) - // HeartBeat payload should remain empty regardless of charging station configuration + // Heartbeat payload should remain empty regardless of charging station configuration assert.notStrictEqual(payload, undefined) assert.strictEqual(typeof payload, 'object') assert.strictEqual(Object.keys(payload as object).length, 0) @@ -158,7 +158,7 @@ await describe('G02 - Heartbeat', async () => { }) // FR: G02.FR.06 - await it('should build empty HeartBeat request conforming to OCPP 2.0 specification', () => { + await it('should build empty Heartbeat request conforming to OCPP 2.0 specification', () => { const requestParams: OCPP20HeartbeatRequest = {} const payload = testableRequestService.buildRequestPayload( @@ -167,7 +167,7 @@ await describe('G02 - Heartbeat', async () => { requestParams ) - // According to OCPP 2.0 specification, HeartBeat request should be an empty object + // According to OCPP 2.0 specification, Heartbeat request should be an empty object // This validates compliance with the official OCPP 2.0 standard assert.notStrictEqual(payload, undefined) assert.deepStrictEqual(payload, {}) diff --git a/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-enforceMessageLimits.test.ts b/tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-EnforceMessageLimits.test.ts similarity index 100% rename from tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-enforceMessageLimits.test.ts rename to tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-EnforceMessageLimits.test.ts diff --git a/tests/charging-station/ocpp/OCPPServiceUtils-meterValues.test.ts b/tests/charging-station/ocpp/OCPPServiceUtils-MeterValues.test.ts similarity index 100% rename from tests/charging-station/ocpp/OCPPServiceUtils-meterValues.test.ts rename to tests/charging-station/ocpp/OCPPServiceUtils-MeterValues.test.ts diff --git a/tests/charging-station/ocpp/OCPPServiceUtils-pure.test.ts b/tests/charging-station/ocpp/OCPPServiceUtils-Pure.test.ts similarity index 100% rename from tests/charging-station/ocpp/OCPPServiceUtils-pure.test.ts rename to tests/charging-station/ocpp/OCPPServiceUtils-Pure.test.ts diff --git a/tests/charging-station/ocpp/OCPPServiceUtils-validation.test.ts b/tests/charging-station/ocpp/OCPPServiceUtils-Validation.test.ts similarity index 100% rename from tests/charging-station/ocpp/OCPPServiceUtils-validation.test.ts rename to tests/charging-station/ocpp/OCPPServiceUtils-Validation.test.ts diff --git a/tests/charging-station/ui-server/UIMCPServer.integration.test.ts b/tests/charging-station/ui-server/UIMCPServer-Integration.test.ts similarity index 100% rename from tests/charging-station/ui-server/UIMCPServer.integration.test.ts rename to tests/charging-station/ui-server/UIMCPServer-Integration.test.ts diff --git a/tests/utils/Configuration-hot-reload.test.ts b/tests/utils/Configuration-HotReload.test.ts similarity index 100% rename from tests/utils/Configuration-hot-reload.test.ts rename to tests/utils/Configuration-HotReload.test.ts diff --git a/tests/utils/ConfigurationValidation-perf.test.ts b/tests/utils/ConfigurationValidation-Perf.test.ts similarity index 100% rename from tests/utils/ConfigurationValidation-perf.test.ts rename to tests/utils/ConfigurationValidation-Perf.test.ts -- 2.53.0