diff options
| author | Uri Shaked | 2025-02-11 10:22:50 +0200 |
|---|---|---|
| committer | Uri Shaked | 2025-02-11 10:22:50 +0200 |
| commit | 05c5c7e9069e1ace3441c1f8f12e45b3d304748e (patch) | |
| tree | 8047a1a96c544794300bd80ecfc4590315be7076 /src/peripherals/spi.spec.ts | |
| parent | ci: update Node.js versions (diff) | |
| download | avr8js-05c5c7e9069e1ace3441c1f8f12e45b3d304748e.tar.gz avr8js-05c5c7e9069e1ace3441c1f8f12e45b3d304748e.tar.bz2 avr8js-05c5c7e9069e1ace3441c1f8f12e45b3d304748e.zip | |
test: migrate tests from jest to vitest
Diffstat (limited to 'src/peripherals/spi.spec.ts')
| -rw-r--r-- | src/peripherals/spi.spec.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/peripherals/spi.spec.ts b/src/peripherals/spi.spec.ts index da429fe..72884c5 100644 --- a/src/peripherals/spi.spec.ts +++ b/src/peripherals/spi.spec.ts @@ -1,6 +1,7 @@ +import { describe, expect, it, vi } from 'vitest'; import { CPU } from '../cpu/cpu'; -import { AVRSPI, spiConfig } from './spi'; import { asmProgram, TestProgramRunner } from '../utils/test-utils'; +import { AVRSPI, spiConfig } from './spi'; const FREQ_16MHZ = 16e6; @@ -99,7 +100,7 @@ describe('SPI', () => { it('should call the `onByteTransfer` callback when initiating an SPI trasfer by writing to SPDR', () => { const cpu = new CPU(new Uint16Array(1024)); const spi = new AVRSPI(cpu, spiConfig, FREQ_16MHZ); - spi.onByte = jest.fn(); + spi.onByte = vi.fn(); cpu.writeData(SPCR, SPE | MSTR); cpu.writeData(SPDR, 0x8f); @@ -110,7 +111,7 @@ describe('SPI', () => { it('should ignore SPDR writes when the SPE bit in SPCR is clear', () => { const cpu = new CPU(new Uint16Array(1024)); const spi = new AVRSPI(cpu, spiConfig, FREQ_16MHZ); - spi.onByte = jest.fn(); + spi.onByte = vi.fn(); cpu.writeData(SPCR, MSTR); cpu.writeData(SPDR, 0x8f); |
