setConfigurationKeyValue,
} from '../../src/charging-station/ConfigurationKeyUtils.js'
import { logger } from '../../src/utils/Logger.js'
+import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
import { createMockChargingStation } from './ChargingStationTestUtils.js'
const TEST_KEY_1 = 'TestKey1'
const VALUE_A = 'ValueA'
const VALUE_B = 'ValueB'
-await describe('ConfigurationKeyUtils test suite', async () => {
+await describe('ConfigurationKeyUtils', async () => {
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
await describe('getConfigurationKey()', async () => {
createMockChargingStationTemplate,
} from './ChargingStationTestUtils.js'
-await describe('Helpers test suite', async () => {
+await describe('Helpers', async () => {
const baseName = 'CS-TEST'
const chargingStationTemplate = createMockChargingStationTemplate(baseName)
OCPPVersion,
} from '../../../../src/types/index.js'
import { Constants } from '../../../../src/utils/index.js'
+import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
import { createMockCertificateManager } from './OCPP20TestUtils.js'
})
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
await describe('Valid Certificate Chain Installation', async () => {
import { OCPPAuthServiceFactory } from '../../../../src/charging-station/ocpp/auth/services/OCPPAuthServiceFactory.js'
import { GenericStatus, OCPPVersion } from '../../../../src/types/index.js'
import { Constants } from '../../../../src/utils/index.js'
+import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
await describe('C11 - Clear Authorization Data in Authorization Cache', async () => {
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
ReasonCodeEnumType,
} from '../../../../src/types/index.js'
import { Constants } from '../../../../src/utils/index.js'
+import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
import {
await describe('I04 - DeleteCertificate', async () => {
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
OCPPVersion,
} from '../../../../src/types/index.js'
import { Constants } from '../../../../src/utils/index.js'
+import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
import {
})
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
OCPPVersion,
} from '../../../../src/types/index.js'
import { Constants } from '../../../../src/utils/index.js'
+import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
import {
await describe('I03 - InstallCertificate', async () => {
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
} from '../../../../src/types/index.js'
import { type ChargingStationType } from '../../../../src/types/ocpp/2.0/Common.js'
import { Constants } from '../../../../src/utils/index.js'
+import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import {
TEST_CHARGE_POINT_MODEL,
TEST_CHARGE_POINT_SERIAL_NUMBER,
})
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
OCPPVersion,
} from '../../../../src/types/index.js'
import { Constants, has } from '../../../../src/utils/index.js'
+import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import {
TEST_CHARGE_POINT_MODEL,
TEST_CHARGE_POINT_SERIAL_NUMBER,
})
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
ReasonCodeEnumType,
} from '../../../../src/types/index.js'
import { Constants } from '../../../../src/utils/index.js'
+import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
})
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
type ReportDataType,
} from '../../../../src/types/index.js'
import { Constants } from '../../../../src/utils/index.js'
+import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import {
TEST_CHARGE_POINT_MODEL,
TEST_CHARGE_POINT_SERIAL_NUMBER,
})
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
OCPPVersion,
} from '../../../../src/types/index.js'
import { Constants } from '../../../../src/utils/index.js'
+import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_CHARGING_STATION_BASE_NAME } from '../../ChargingStationTestConstants.js'
import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
})
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
OCPPVersion,
} from '../../../../src/types/index.js'
import { Constants } from '../../../../src/utils/index.js'
+import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import {
TEST_FIRMWARE_VERSION,
TEST_STATUS_CHARGE_POINT_MODEL,
})
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
return base + fillerChar.repeat(targetLength - base.length)
}
-await describe('B05/B06 - OCPP20VariableManager test suite', async () => {
+await describe('B05 - OCPP20VariableManager', async () => {
// Type declaration for mock ChargingStation
let station: ChargingStation
IdentifierType,
} from '../../../../src/charging-station/ocpp/auth/types/AuthTypes.js'
import { OCPPVersion } from '../../../../src/types/ocpp/OCPPVersion.js'
+import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
import { createMockAuthRequest, createMockIdentifier } from './helpers/MockFactories.js'
})
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
} from '../../../../../src/charging-station/ocpp/auth/types/AuthTypes.js'
import { OCPP16AuthorizationStatus } from '../../../../../src/types/ocpp/1.6/Transaction.js'
import { OCPPVersion } from '../../../../../src/types/ocpp/OCPPVersion.js'
+import { standardCleanup } from '../../../../helpers/TestLifecycleHelpers.js'
import { createMockAuthorizationResult, createMockIdentifier } from '../helpers/MockFactories.js'
await describe('OCPP16AuthAdapter', async () => {
afterEach(() => {
mock.restoreAll()
+ standardCleanup()
})
await describe('constructor', async () => {
RequestStartStopStatusEnumType,
} from '../../../../../src/types/ocpp/2.0/Transaction.js'
import { OCPPVersion } from '../../../../../src/types/ocpp/OCPPVersion.js'
+import { standardCleanup } from '../../../../helpers/TestLifecycleHelpers.js'
import { createMockAuthorizationResult, createMockIdentifier } from '../helpers/MockFactories.js'
await describe('OCPP20AuthAdapter', async () => {
afterEach(() => {
mock.restoreAll()
+ standardCleanup()
})
await describe('constructor', async () => {
AuthenticationMethod,
AuthorizationStatus,
} from '../../../../../src/charging-station/ocpp/auth/types/AuthTypes.js'
+import { standardCleanup } from '../../../../helpers/TestLifecycleHelpers.js'
import { createMockAuthorizationResult } from '../helpers/MockFactories.js'
/**
})
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
IdentifierType,
} from '../../../../../src/charging-station/ocpp/auth/types/AuthTypes.js'
import { OCPPVersion } from '../../../../../src/types/ocpp/OCPPVersion.js'
+import { standardCleanup } from '../../../../helpers/TestLifecycleHelpers.js'
import {
createMockAuthorizationResult,
createMockAuthRequest,
afterEach(() => {
mock.restoreAll()
+ standardCleanup()
})
await describe('constructor', async () => {
IdentifierType,
} from '../../../../../src/charging-station/ocpp/auth/types/AuthTypes.js'
import { OCPPVersion } from '../../../../../src/types/ocpp/OCPPVersion.js'
+import { standardCleanup } from '../../../../helpers/TestLifecycleHelpers.js'
import {
createMockAuthCache,
createMockAuthorizationResult,
afterEach(() => {
mock.restoreAll()
+ standardCleanup()
})
await describe('constructor', async () => {
IdentifierType,
} from '../../../../../src/charging-station/ocpp/auth/types/AuthTypes.js'
import { OCPPVersion } from '../../../../../src/types/ocpp/OCPPVersion.js'
+import { standardCleanup } from '../../../../helpers/TestLifecycleHelpers.js'
import {
createMockAuthCache,
createMockAuthRequest,
afterEach(() => {
mock.restoreAll()
+ standardCleanup()
})
await describe('constructor', async () => {
RequestStartStopStatusEnumType,
} from '../../../../../src/types/ocpp/2.0/Transaction.js'
import { OCPPVersion } from '../../../../../src/types/ocpp/OCPPVersion.js'
+import { standardCleanup } from '../../../../helpers/TestLifecycleHelpers.js'
await describe('AuthTypes', async () => {
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
await describe('IdentifierTypeGuards', async () => {
} from '../../../../../src/charging-station/ocpp/auth/types/AuthTypes.js'
import { AuthHelpers } from '../../../../../src/charging-station/ocpp/auth/utils/AuthHelpers.js'
import { OCPPVersion } from '../../../../../src/types/ocpp/OCPPVersion.js'
+import { standardCleanup } from '../../../../helpers/TestLifecycleHelpers.js'
await describe('AuthHelpers', async () => {
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
await describe('calculateTTL', async () => {
} from '../../../../../src/charging-station/ocpp/auth/types/AuthTypes.js'
import { AuthValidators } from '../../../../../src/charging-station/ocpp/auth/utils/AuthValidators.js'
import { OCPPVersion } from '../../../../../src/types/ocpp/OCPPVersion.js'
+import { standardCleanup } from '../../../../helpers/TestLifecycleHelpers.js'
await describe('AuthValidators', async () => {
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
await describe('isValidCacheTTL', async () => {
AuthorizationStatus,
} from '../../../../../src/charging-station/ocpp/auth/types/AuthTypes.js'
import { AuthConfigValidator } from '../../../../../src/charging-station/ocpp/auth/utils/ConfigValidator.js'
+import { standardCleanup } from '../../../../helpers/TestLifecycleHelpers.js'
await describe('AuthConfigValidator', async () => {
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
await describe('validate', async () => {
import { UIHttpServer } from '../../../src/charging-station/ui-server/UIHttpServer.js'
import { DEFAULT_COMPRESSION_THRESHOLD } from '../../../src/charging-station/ui-server/UIServerSecurity.js'
import { ApplicationProtocol, ResponseStatus } from '../../../src/types/index.js'
+import { standardCleanup } from '../../helpers/TestLifecycleHelpers.js'
import { GZIP_STREAM_FLUSH_DELAY_MS, TEST_UUID } from './UIServerTestConstants.js'
import {
createMockUIServerConfiguration,
status,
})
-await describe('UIHttpServer test suite', async () => {
+await describe('UIHttpServer', async () => {
afterEach(() => {
mock.restoreAll()
+ standardCleanup()
})
await it('should delete response handler after successful send', () => {
const server = new TestableUIHttpServer(createHttpServerConfig())
isValidCredential,
isValidNumberOfStations,
} from '../../../src/charging-station/ui-server/UIServerSecurity.js'
+import { standardCleanup } from '../../helpers/TestLifecycleHelpers.js'
import { waitForStreamFlush } from './UIServerTestUtils.js'
const RATE_WINDOW_EXPIRY_DELAY_MS = 110
-await describe('UIServerSecurity test suite', async () => {
+await describe('UIServerSecurity', async () => {
afterEach(() => {
mock.restoreAll()
+ standardCleanup()
})
await describe('isValidCredential()', async () => {
await it('should return true for matching credentials', () => {
import type { UUIDv4 } from '../../../src/types/index.js'
import { ProcedureName, ResponseStatus } from '../../../src/types/index.js'
+import { standardCleanup } from '../../helpers/TestLifecycleHelpers.js'
import { TEST_UUID } from './UIServerTestConstants.js'
import {
createMockUIServerConfiguration,
TestableUIWebSocketServer,
} from './UIServerTestUtils.js'
-await describe('UIWebSocketServer test suite', async () => {
+await describe('UIWebSocketServer', async () => {
afterEach(() => {
mock.restoreAll()
+ standardCleanup()
})
await it('should delete response handler after successful send', () => {
const config = createMockUIServerConfiguration()
import { afterEach, describe, it, mock } from 'node:test'
import { ProcedureName, ProtocolVersion, ResponseStatus } from '../../../../src/types/index.js'
+import { standardCleanup } from '../../../helpers/TestLifecycleHelpers.js'
import { TEST_HASH_ID, TEST_UUID } from '../UIServerTestConstants.js'
import {
createMockChargingStationData,
TestableUIWebSocketServer,
} from '../UIServerTestUtils.js'
-await describe('AbstractUIService test suite', async () => {
+await describe('AbstractUIService', async () => {
afterEach(() => {
mock.restoreAll()
+ standardCleanup()
})
await it('should check response handler existence before sending', () => {
const config = createMockUIServerConfiguration()
import { afterEach, describe, it, mock } from 'node:test'
import { BaseError } from '../../src/exception/BaseError.js'
+import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
-await describe('BaseError test suite', async () => {
+await describe('BaseError', async () => {
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
await it('should create instance with default values', () => {
import { OCPPError } from '../../src/exception/OCPPError.js'
import { ErrorType } from '../../src/types/index.js'
import { Constants } from '../../src/utils/Constants.js'
+import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
-await describe('OCPPError test suite', async () => {
+await describe('OCPPError', async () => {
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
ConfigurationSection,
SupervisionUrlDistribution,
} from '../../src/types/ConfigurationData.js'
+import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
-await describe('ConfigurationData test suite', async () => {
+await describe('ConfigurationData', async () => {
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
import { afterEach, describe, it, mock } from 'node:test'
import { AsyncLock, AsyncLockType } from '../../src/utils/AsyncLock.js'
+import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
-await describe('AsyncLock test suite', async () => {
+await describe('AsyncLock', async () => {
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
await it('should run synchronous functions exclusively in sequence', () => {
} from '../../src/utils/ConfigurationUtils.js'
import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
-await describe('ConfigurationUtils test suite', async () => {
+await describe('ConfigurationUtils', async () => {
afterEach(() => {
standardCleanup()
})
import { afterEach, describe, it, mock } from 'node:test'
import { ACElectricUtils, DCElectricUtils } from '../../src/utils/ElectricUtils.js'
+import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
-await describe('ElectricUtils test suite', async () => {
+await describe('ElectricUtils', async () => {
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
await it('should calculate DC power from voltage and current', () => {
import { createMockChargingStation } from '../charging-station/ChargingStationTestUtils.js'
import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
-await describe('ErrorUtils test suite', async () => {
+await describe('ErrorUtils', async () => {
const { station: chargingStation } = createMockChargingStation({ baseName: 'CS-TEST' })
afterEach(() => {
import { afterEach, describe, it, mock } from 'node:test'
import { average, max, median, min, percentile, std } from '../../src/utils/StatisticUtils.js'
+import { standardCleanup } from '../helpers/TestLifecycleHelpers.js'
-await describe('StatisticUtils test suite', async () => {
+await describe('StatisticUtils', async () => {
afterEach(() => {
+ standardCleanup()
mock.restoreAll()
})
await it('should calculate arithmetic mean of array values', () => {
} from '../../src/utils/Utils.js'
import { standardCleanup, withMockTimers } from '../helpers/TestLifecycleHelpers.js'
-await describe('Utils test suite', async () => {
+await describe('Utils', async () => {
afterEach(() => {
standardCleanup()
})
} from '../../src/worker/WorkerUtils.js'
import { standardCleanup, withMockTimers } from '../helpers/TestLifecycleHelpers.js'
-await describe('WorkerUtils test suite', async () => {
+await describe('WorkerUtils', async () => {
afterEach(() => {
standardCleanup()
})