From: Jérôme Benoit Date: Sun, 1 Mar 2026 01:08:26 +0000 (+0100) Subject: fix(test): remove redundant standardCleanup() from nested afterEach X-Git-Tag: ocpp-server@v3.0.0~47 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=cee36fe440c0680876af94e55aadb369c3b1bf2c;p=e-mobility-charging-stations-simulator.git fix(test): remove redundant standardCleanup() from nested afterEach UIHttpServer and OCPP20AuthAdapter tests had nested describes with afterEach blocks calling standardCleanup(), duplicating the outer afterEach cleanup. This could cause mock.restoreAll() to be called twice per test, potentially causing issues on Windows. --- diff --git a/tests/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.test.ts b/tests/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.test.ts index cc6feba5..73ee696a 100644 --- a/tests/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.test.ts +++ b/tests/charging-station/ocpp/auth/adapters/OCPP20AuthAdapter.test.ts @@ -406,7 +406,6 @@ await describe('OCPP20AuthAdapter', async () => { }) afterEach(() => { - standardCleanup() mock.reset() }) diff --git a/tests/charging-station/ui-server/UIHttpServer.test.ts b/tests/charging-station/ui-server/UIHttpServer.test.ts index 8a36beed..978a5c8d 100644 --- a/tests/charging-station/ui-server/UIHttpServer.test.ts +++ b/tests/charging-station/ui-server/UIHttpServer.test.ts @@ -194,10 +194,6 @@ await describe('UIHttpServer', async () => { gzipServer = new TestableUIHttpServer(createHttpServerConfig()) }) - afterEach(() => { - standardCleanup() - }) - await it('should skip compression when acceptsGzip is false', () => { const res = new MockServerResponse()