diff --git a/frontend/src/__tests__/AVRSimulator.test.ts b/frontend/src/__tests__/AVRSimulator.test.ts index f98cfd42..f88b9a44 100644 --- a/frontend/src/__tests__/AVRSimulator.test.ts +++ b/frontend/src/__tests__/AVRSimulator.test.ts @@ -168,7 +168,7 @@ describe('AVRSimulator — PWM OCR monitoring', () => { sim.start(); sim.stop(); - expect(pwmCb).toHaveBeenCalledWith(9, 128 / 255); + expect(pwmCb).toHaveBeenCalledWith(9, 128 / 255, expect.anything()); // 3rd arg = sim timeMs }); it('PWM covers all six Arduino PWM pins', () => { @@ -202,7 +202,7 @@ describe('AVRSimulator — PWM OCR monitoring', () => { PWM_MAP.forEach(({ pin }, i) => { const expected = ((i + 1) * 25) / 255; - expect(cbs[pin]).toHaveBeenCalledWith(pin, expected); + expect(cbs[pin]).toHaveBeenCalledWith(pin, expected, expect.anything()); // 3rd arg = sim timeMs }); }); }); diff --git a/frontend/src/__tests__/PinManager.test.ts b/frontend/src/__tests__/PinManager.test.ts index e0db42ac..b98cca16 100644 --- a/frontend/src/__tests__/PinManager.test.ts +++ b/frontend/src/__tests__/PinManager.test.ts @@ -124,7 +124,7 @@ describe('PinManager — PWM duty cycle', () => { const cb = vi.fn(); pm.onPwmChange(9, cb); pm.updatePwm(9, 0.5); - expect(cb).toHaveBeenCalledWith(9, 0.5); + expect(cb).toHaveBeenCalledWith(9, 0.5, undefined); // 3rd arg = optional timeMs (not passed here) }); it('stores the latest PWM value', () => { @@ -150,7 +150,7 @@ describe('PinManager — PWM duty cycle', () => { pwmPins.forEach((pin, i) => { const dc = (i + 1) / 6; pm.updatePwm(pin, dc); - expect(callbacks[i]).toHaveBeenCalledWith(pin, dc); + expect(callbacks[i]).toHaveBeenCalledWith(pin, dc, undefined); // optional timeMs not passed }); }); }); diff --git a/frontend/src/__tests__/attiny85-simulation.test.ts b/frontend/src/__tests__/attiny85-simulation.test.ts index 5843c765..2c66826b 100644 --- a/frontend/src/__tests__/attiny85-simulation.test.ts +++ b/frontend/src/__tests__/attiny85-simulation.test.ts @@ -283,7 +283,7 @@ describe('ATtiny85 — PWM monitoring', () => { sim.start(); sim.stop(); - expect(pwmCb).toHaveBeenCalledWith(1, 128 / 255); + expect(pwmCb).toHaveBeenCalledWith(1, 128 / 255, expect.anything()); // 3rd arg = sim timeMs }); it('PinManager receives PWM update on pin 0 when OCR0A (0x56) is written', () => { @@ -300,7 +300,7 @@ describe('ATtiny85 — PWM monitoring', () => { sim.start(); sim.stop(); - expect(pwmCb).toHaveBeenCalledWith(0, 64 / 255); + expect(pwmCb).toHaveBeenCalledWith(0, 64 / 255, expect.anything()); // 3rd arg = sim timeMs }); it('ATtiny85 PWM covers 4 pins (OCR0A/OCR0B/OCR1A/OCR1B)', () => { diff --git a/frontend/src/__tests__/mega-emulation.test.ts b/frontend/src/__tests__/mega-emulation.test.ts index 0752eeda..4f373576 100644 --- a/frontend/src/__tests__/mega-emulation.test.ts +++ b/frontend/src/__tests__/mega-emulation.test.ts @@ -301,7 +301,7 @@ describe('AVRSimulator Mega — PWM OCR mapping differs from Uno', () => { // Call pollPwmRegisters directly — avoids RAF dependency in unit tests (sim as any).pollPwmRegisters(); - expect(cb).toHaveBeenCalledWith(13, 128 / 255); + expect(cb).toHaveBeenCalledWith(13, 128 / 255, expect.anything()); // 3rd arg = sim timeMs sim.stop(); }); @@ -318,7 +318,7 @@ describe('AVRSimulator Mega — PWM OCR mapping differs from Uno', () => { (sim as any).pollPwmRegisters(); - expect(cb).toHaveBeenCalledWith(5, 200 / 255); + expect(cb).toHaveBeenCalledWith(5, 200 / 255, expect.anything()); // 3rd arg = sim timeMs sim.stop(); }); @@ -335,7 +335,7 @@ describe('AVRSimulator Mega — PWM OCR mapping differs from Uno', () => { (sim as any).pollPwmRegisters(); - expect(cb).toHaveBeenCalledWith(6, 100 / 255); + expect(cb).toHaveBeenCalledWith(6, 100 / 255, expect.anything()); // 3rd arg = sim timeMs sim.stop(); }); });