The Reset test had nested describes (B11, B12) with their own afterEach
calling standardCleanup(), plus an outer afterEach calling mock.timers.reset()
then standardCleanup(). This caused mock.restoreAll() to be called twice
per test with timer reset in between - leaving MockTracker in inconsistent
state on Windows.
Also harmonize StationHelpers cleanup to use '= undefined' consistently
instead of mixing with 'delete'.
}
if (connectorStatus.transactionTxUpdatedSetInterval != null) {
clearInterval(connectorStatus.transactionTxUpdatedSetInterval)
- delete connectorStatus.transactionTxUpdatedSetInterval
+ connectorStatus.transactionTxUpdatedSetInterval = undefined
}
}
}
if (connectorStatus.transactionTxUpdatedSetInterval != null) {
clearInterval(connectorStatus.transactionTxUpdatedSetInterval)
- delete connectorStatus.transactionTxUpdatedSetInterval
+ connectorStatus.transactionTxUpdatedSetInterval = undefined
}
}
}
b11MockStation.reset = () => Promise.resolve()
})
- afterEach(() => {
- standardCleanup()
- })
-
// FR: B11.FR.01
await it('should handle Reset request with Immediate type when no transactions', async () => {
const resetRequest: OCPP20ResetRequest = {
b12MockStation.reset = () => Promise.resolve()
})
- afterEach(() => {
- standardCleanup()
- })
-
// FR: B12.FR.02
await it('should handle immediate reset with active transactions', async () => {
// Mock active transactions