test(gateway): use lightweight clears in client close setup

This commit is contained in:
Peter Steinberger
2026-02-22 07:47:49 +00:00
parent 4ddaafee68
commit 9daab2abb3

View File

@@ -185,10 +185,11 @@ describe("GatewayClient security checks", () => {
describe("GatewayClient close handling", () => { describe("GatewayClient close handling", () => {
beforeEach(() => { beforeEach(() => {
wsInstances.length = 0; wsInstances.length = 0;
clearDeviceAuthTokenMock.mockReset(); clearDeviceAuthTokenMock.mockClear();
clearDevicePairingMock.mockReset(); clearDeviceAuthTokenMock.mockImplementation(() => undefined);
clearDevicePairingMock.mockClear();
clearDevicePairingMock.mockResolvedValue(true); clearDevicePairingMock.mockResolvedValue(true);
logDebugMock.mockReset(); logDebugMock.mockClear();
}); });
it("clears stale token on device token mismatch close", () => { it("clears stale token on device token mismatch close", () => {