Skip to content

Commit 755a7f9

Browse files
committed
test(watchdog): more robust tests
add assertions, fix #115
1 parent e76663c commit 755a7f9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/peripherals/watchdog.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,12 @@ describe('Watchdog', () => {
118118
// Now we skip 8ms. Watchdog shouldn't fire, yet
119119
cpu.cycles += 16000 * 8;
120120
runner.runInstructions(1);
121+
expect(cpu.pc).not.toEqual(0);
121122

122123
// Now we skip an extra 8ms. We extended the timeout with WDR, so watchdog won't fire yet
123124
cpu.cycles += 16000 * 8;
124125
runner.runInstructions(1);
126+
expect(cpu.pc).not.toEqual(0);
125127

126128
// Finally, another 8ms bring us to 16ms since last WDR, and watchdog should fire
127129
cpu.cycles += 16000 * 8;

0 commit comments

Comments
 (0)