* @file Tests for OCPP20CertificateManager
* @description Unit tests for OCPP 2.0 certificate management and validation
*/
-/* eslint-disable @typescript-eslint/no-explicit-any */
import { expect } from '@std/expect'
import { rm } from 'node:fs/promises'
await it('should return false for null/undefined input', () => {
const manager = new OCPP20CertificateManager()
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- testing invalid null input
expect(manager.validateCertificateFormat(null as any)).toBe(false)
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- testing invalid undefined input
expect(manager.validateCertificateFormat(undefined as any)).toBe(false)
})
* @file Tests for OCPP20IncomingRequestService RemoteStartAuth
* @description Unit tests for OCPP 2.0 remote start pre-authorization (G03.FR.03)
*/
-/* eslint-disable @typescript-eslint/no-unsafe-assignment */
-
-/* eslint-disable @typescript-eslint/no-explicit-any */
import { expect } from '@std/expect'
import { afterEach, beforeEach, describe, it } from 'node:test'
import { OCPPVersion } from '../../../../src/types/ocpp/OCPPVersion.js'
await describe('OCPP20IncomingRequestService - G03.FR.03 Remote Start Pre-Authorization', async () => {
- let service: OCPP20IncomingRequestService
- let mockChargingStation: ChargingStation
+ let service: OCPP20IncomingRequestService | undefined
+ let mockChargingStation: ChargingStation | undefined
beforeEach(() => {
// Mock charging station with EVSE configuration
afterEach(() => {
// Reset service and mock charging station state
- mockChargingStation = undefined as any
- service = undefined as any
+ mockChargingStation = undefined
+ service = undefined
})
await describe('G03.FR.03.001 - Successful remote start with valid token', async () => {
// Given: Request without evseId (null)
const request: OCPP20RequestStartTransactionRequest = {
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any -- testing invalid null input
evseId: null as any,
idToken: {
idToken: 'VALID_TOKEN_005',
// Given: Request without evseId (undefined)
const request: OCPP20RequestStartTransactionRequest = {
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any -- testing invalid undefined input
evseId: undefined as any,
idToken: {
idToken: 'VALID_TOKEN_006',