/* eslint-disable @typescript-eslint/no-explicit-any */
import { expect } from '@std/expect'
-import { describe, it } from 'node:test'
+import { afterEach, beforeEach, describe, it, mock } from 'node:test'
import { OCPP20IncomingRequestService } from '../../../../src/charging-station/ocpp/2.0/OCPP20IncomingRequestService.js'
import {
import { createChargingStation } from '../../../ChargingStationFactory.js'
import { TEST_CHARGING_STATION_BASE_NAME } from './OCPP20TestConstants.js'
-// FIXME: tests hang on Windows - root cause unknown (dichotomous search: Reset was last test before hang)
-await describe('B11 & B12 - Reset', { skip: process.platform === 'win32' }, async () => {
+// Reset tests use fake timers to prevent real setInterval/setTimeout from blocking test runner
+// This fixes Windows CI hangs where Node.js test runner waits for all timers to complete
+await describe('B11 & B12 - Reset', async () => {
+ // Enable fake timers for all timer APIs used by Reset handlers
+ beforeEach(() => {
+ mock.timers.enable({ apis: ['setInterval', 'setTimeout', 'setImmediate'] })
+ })
+
+ afterEach(() => {
+ mock.timers.reset()
+ })
+
const mockChargingStation = createChargingStation({
baseName: TEST_CHARGING_STATION_BASE_NAME,
connectorsCount: 3,