diff options
| author | Uri Shaked | 2020-12-12 14:27:41 +0200 |
|---|---|---|
| committer | Uri Shaked | 2020-12-12 14:27:41 +0200 |
| commit | f2d7b1fece7ee3a12aa53bf182c2589cded57210 (patch) | |
| tree | ab3fed57a4795fff5136441618fd4cba1f7dc164 /src | |
| parent | fix(cpu): event system issue (diff) | |
| download | avr8js-f2d7b1fece7ee3a12aa53bf182c2589cded57210.tar.gz avr8js-f2d7b1fece7ee3a12aa53bf182c2589cded57210.tar.bz2 avr8js-f2d7b1fece7ee3a12aa53bf182c2589cded57210.zip | |
test(cpu): fix implicit any error
Diffstat (limited to 'src')
| -rw-r--r-- | src/cpu/cpu.spec.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cpu/cpu.spec.ts b/src/cpu/cpu.spec.ts index 00fbcb3..b1bc876 100644 --- a/src/cpu/cpu.spec.ts +++ b/src/cpu/cpu.spec.ts @@ -1,5 +1,7 @@ import { CPU } from './cpu'; +type ITestEvent = [number, number]; // Expected cycles, actual cycles + describe('cpu', () => { it('should set initial value of SP to the last byte of internal SRAM', () => { const cpu = new CPU(new Uint16Array(1024), 0x1000); @@ -9,7 +11,7 @@ describe('cpu', () => { describe('events', () => { it('should execute queued events after the given number of cycles has passed', () => { const cpu = new CPU(new Uint16Array(1024), 0x1000); - const events = []; + const events: ITestEvent[] = []; for (const i of [1, 4, 10]) { cpu.addClockEvent(() => events.push([i, cpu.cycles]), i); } @@ -27,7 +29,7 @@ describe('cpu', () => { describe('updateClockEvent', () => { it('should update the number of cycles for the given clock event', () => { const cpu = new CPU(new Uint16Array(1024), 0x1000); - const events = []; + const events: ITestEvent[] = []; const callbacks = []; for (const i of [1, 4, 10]) { callbacks[i] = cpu.addClockEvent(() => events.push([i, cpu.cycles]), i); @@ -48,7 +50,7 @@ describe('cpu', () => { describe('clearClockEvent', () => { it('should remove the given clock event', () => { const cpu = new CPU(new Uint16Array(1024), 0x1000); - const events = []; + const events: ITestEvent[] = []; const callbacks = []; for (const i of [1, 4, 10]) { callbacks[i] = cpu.addClockEvent(() => events.push([i, cpu.cycles]), i); |
