test(esp32): add hardResetPinStates to PinManager mocks in 6 test files

Same root cause as the previous test fix in 3e38397 — upstream commit
d64eebc (fix(stop): reset CPU to PC=0) added a hardResetPinStates() call
to useSimulatorStore.stopBoard. The vi.mock factories in these 6 ESP32-
adjacent test files only exposed updatePort/onPinChange/getListenersCount,
so any test path that hits stopBoard crashed with "is not a function"
once the real prod code called the new method.

Each gets a single-line addition: this.hardResetPinStates = vi.fn();

Verified with full vitest run: 127 files pass, 2,005 tests pass, 0 failures.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
David Montero 2026-05-28 19:31:43 +02:00
parent 3e38397366
commit 0d37472aa3
6 changed files with 6 additions and 0 deletions

View File

@ -58,6 +58,7 @@ vi.mock('../simulation/PinManager', () => ({
this.onPinChange = vi.fn().mockReturnValue(() => {});
this.onPwmChange = vi.fn().mockReturnValue(() => {});
this.getListenersCount = vi.fn().mockReturnValue(0);
this.hardResetPinStates = vi.fn();
this.updatePwm = vi.fn();
}),
}));

View File

@ -46,6 +46,7 @@ vi.mock('../simulation/PinManager', () => ({
this.updatePort = vi.fn();
this.onPinChange = vi.fn().mockReturnValue(() => {});
this.getListenersCount = vi.fn().mockReturnValue(0);
this.hardResetPinStates = vi.fn();
this.resetPinStates = vi.fn();
}),
}));

View File

@ -70,6 +70,7 @@ vi.mock('../simulation/PinManager', () => ({
this.onPinChange = vi.fn().mockReturnValue(() => {});
this.onPwmChange = vi.fn().mockReturnValue(() => {});
this.getListenersCount = vi.fn().mockReturnValue(0);
this.hardResetPinStates = vi.fn();
this.updatePwm = vi.fn();
this.triggerPinChange = vi.fn();
}),

View File

@ -45,6 +45,7 @@ vi.mock('../simulation/PinManager', () => ({
this.updatePort = vi.fn();
this.onPinChange = vi.fn().mockReturnValue(() => {});
this.getListenersCount = vi.fn().mockReturnValue(0);
this.hardResetPinStates = vi.fn();
}),
}));

View File

@ -47,6 +47,7 @@ vi.mock('../simulation/PinManager', () => ({
this.updatePort = vi.fn();
this.onPinChange = vi.fn().mockReturnValue(() => {});
this.getListenersCount = vi.fn().mockReturnValue(0);
this.hardResetPinStates = vi.fn();
}),
}));

View File

@ -46,6 +46,7 @@ vi.mock('../simulation/PinManager', () => ({
this.updatePort = vi.fn();
this.onPinChange = vi.fn().mockReturnValue(() => {});
this.getListenersCount = vi.fn().mockReturnValue(0);
this.hardResetPinStates = vi.fn();
}),
}));