]> Piment Noir Git Repositories - e-mobility-charging-stations-simulator.git/commitdiff
fix(tests): add missing @file headers and standardCleanup()
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 3 Mar 2026 17:42:33 +0000 (18:42 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 3 Mar 2026 17:42:33 +0000 (18:42 +0100)
Add mandatory @file JSDoc headers to 3 test files and
standardCleanup() afterEach to 2 test files per
TEST_STYLE_GUIDE.md sections 2 and 3.

tests/charging-station/ocpp/2.0/OCPP20Integration-Certificate.test.ts
tests/charging-station/ocpp/2.0/OCPP20Integration.test.ts
tests/charging-station/ocpp/2.0/OCPP20SchemaValidation.test.ts
tests/charging-station/ocpp/2.0/OCPP20ServiceUtils-enforceMessageLimits.test.ts

index 00bded37e277aa9bf82904c7611ad71627b10bc2..6e617381bfbcd869f6933455d5106b89ca700e8b 100644 (file)
@@ -1,3 +1,8 @@
+/**
+ * @file Tests for OCPP 2.0 certificate integration lifecycle
+ * @description Verifies certificate install, list, and delete operations end-to-end
+ */
+
 import { expect } from '@std/expect'
 import { afterEach, beforeEach, describe, it } from 'node:test'
 
index 261e235901eeea04863ad2976781a5843afdf885..949eb402e66ae399af4c97ff0d367382cc3ef7be 100644 (file)
@@ -1,3 +1,8 @@
+/**
+ * @file Tests for OCPP 2.0 integration (SetVariables → GetVariables consistency)
+ * @description Verifies that SetVariables and GetVariables produce consistent results
+ */
+
 import { expect } from '@std/expect'
 import { afterEach, beforeEach, describe, it } from 'node:test'
 
index 277cdb8e1c6a466e1964b6bb4a3e7ec45b4e2c9e..35388ee8b9fb005cf6afd19d4c304868d49f2a09 100644 (file)
@@ -14,9 +14,11 @@ import _Ajv, { type ValidateFunction } from 'ajv'
 import _ajvFormats from 'ajv-formats'
 import { readFileSync } from 'node:fs'
 import { join } from 'node:path'
-import { describe, it } from 'node:test'
+import { afterEach, describe, it } from 'node:test'
 import { fileURLToPath } from 'node:url'
 
+import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
+
 const AjvConstructor = _Ajv.default
 const ajvFormats = _ajvFormats.default
 
@@ -49,6 +51,10 @@ function makeValidator (schemaFile: string): ValidateFunction {
 }
 
 await describe('OCPP 2.0 schema validation — negative tests', async () => {
+  afterEach(() => {
+    standardCleanup()
+  })
+
   await it('AJV compiles ResetRequest schema without error (strict:false required)', () => {
     // Verifies the AJV configuration works for schemas using additionalItems pattern
     expect(() => makeValidator('ResetRequest.json')).not.toThrow()
index 40851b6492f705c87b3f7f9ab36b4543de311a4f..ec5a2e3bbe4645239340d230e16200a530346229 100644 (file)
@@ -1,7 +1,13 @@
+/**
+ * @file Tests for OCPP20ServiceUtils.enforceMessageLimits
+ * @description Verifies message limit enforcement logic for OCPP 2.0 payloads
+ */
+
 import { expect } from '@std/expect'
-import { describe, it } from 'node:test'
+import { afterEach, describe, it } from 'node:test'
 
 import { OCPP20ServiceUtils } from '../../../../src/charging-station/ocpp/2.0/OCPP20ServiceUtils.js'
+import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
 
 interface MockLogger {
   debug: (...args: unknown[]) => void
@@ -59,6 +65,10 @@ function makeRejectedBuilder () {
 }
 
 await describe('OCPP20ServiceUtils.enforceMessageLimits', async () => {
+  afterEach(() => {
+    standardCleanup()
+  })
+
   await describe('no limits configured (both 0)', async () => {
     await it('should return rejected:false and empty results when both limits are 0', () => {
       const station = makeMockStation()