- Fixed OCPPAuthIntegration.test.ts to use createMockChargingStation with destructuring
- Corrected import path in AuthComponentFactory.test.ts (../../../../ → ../../../)
- Fixed OCPP20VariableManager.test.ts type errors by properly extracting .station property
- All 291 tests passing
- Zero migration-related TypeScript compilation errors
Task 9 complete
deleteConfigurationKey,
getConfigurationKey,
} from '../../../../src/charging-station/ConfigurationKeyUtils.js'
+import type { ChargingStation } from '../../../../src/charging-station/ChargingStation.js'
import { createTestableVariableManager } from '../../../../src/charging-station/ocpp/2.0/__testable__/index.js'
import { OCPP20VariableManager } from '../../../../src/charging-station/ocpp/2.0/OCPP20VariableManager.js'
import { VARIABLE_REGISTRY } from '../../../../src/charging-station/ocpp/2.0/OCPP20VariableRegistry.js'
await describe('B05/B06 - OCPP20VariableManager test suite', async () => {
// Type declaration for mock ChargingStation
- let station: ReturnType<typeof createMockChargingStation>
+ let station: ChargingStation
// Initialize mock ChargingStation before each test
beforeEach(() => {
await describe('Unsupported MinSet/MaxSet attribute tests', async () => {
const manager = OCPP20VariableManager.getInstance()
- const station = createChargingStation({
+ const { station } = createMockChargingStation({
baseName: 'MMStation',
connectorsCount: 3,
evseConfiguration: { evsesCount: 3 },
IdentifierType,
} from '../../../../src/charging-station/ocpp/auth/types/AuthTypes.js'
import { OCPPVersion } from '../../../../src/types/ocpp/OCPPVersion.js'
-import { createChargingStation } from '../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../ChargingStationTestUtils.js'
import {
createMockAuthRequest,
createMockOCPP16Identifier,
beforeEach(() => {
// Create mock charging station with OCPP 1.6 configuration
- mockChargingStation16 = createChargingStation({
+ const result16 = createMockChargingStation({
baseName: 'TEST_AUTH_CS_16',
connectorsCount: 2,
stationInfo: {
templateName: 'test-auth-template',
},
})
+ mockChargingStation16 = result16.station
// Create mock charging station with OCPP 2.0 configuration
- mockChargingStation20 = createChargingStation({
+ const result20 = createMockChargingStation({
baseName: 'TEST_AUTH_CS_20',
connectorsCount: 2,
stationInfo: {
templateName: 'test-auth-template',
},
})
+ mockChargingStation20 = result20.station
})
afterEach(() => {
import { AuthComponentFactory } from '../../../../../src/charging-station/ocpp/auth/factories/AuthComponentFactory.js'
import { OCPPVersion } from '../../../../../src/types/ocpp/OCPPVersion.js'
-import { createMockChargingStation } from '../../../../ChargingStationTestUtils.js'
+import { createMockChargingStation } from '../../../ChargingStationTestUtils.js'
import { standardCleanup } from '../../../../helpers/TestLifecycleHelpers.js'
await describe('AuthComponentFactory', async () => {