aboutsummaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorUri Shaked2025-02-11 10:22:50 +0200
committerUri Shaked2025-02-11 10:22:50 +0200
commit05c5c7e9069e1ace3441c1f8f12e45b3d304748e (patch)
tree8047a1a96c544794300bd80ecfc4590315be7076 /src/cpu
parentci: update Node.js versions (diff)
downloadavr8js-05c5c7e9069e1ace3441c1f8f12e45b3d304748e.tar.gz
avr8js-05c5c7e9069e1ace3441c1f8f12e45b3d304748e.tar.bz2
avr8js-05c5c7e9069e1ace3441c1f8f12e45b3d304748e.zip
test: migrate tests from jest to vitest
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/cpu.spec.ts1
-rw-r--r--src/cpu/instruction.spec.ts3
-rw-r--r--src/cpu/interrupt.spec.ts1
3 files changed, 4 insertions, 1 deletions
diff --git a/src/cpu/cpu.spec.ts b/src/cpu/cpu.spec.ts
index e62dcc8..d3e0ef0 100644
--- a/src/cpu/cpu.spec.ts
+++ b/src/cpu/cpu.spec.ts
@@ -1,3 +1,4 @@
+import { describe, expect, it } from 'vitest';
import { AVRClockEventCallback, CPU } from './cpu';
type ITestEvent = [number, number]; // Expected cycles, actual cycles
diff --git a/src/cpu/instruction.spec.ts b/src/cpu/instruction.spec.ts
index 37f0bfd..cf3e547 100644
--- a/src/cpu/instruction.spec.ts
+++ b/src/cpu/instruction.spec.ts
@@ -1,6 +1,7 @@
import { CPU } from './cpu';
import { avrInstruction } from './instruction';
import { assemble } from '../utils/assembler';
+import { describe, it, expect, vi } from 'vitest';
const r0 = 0;
const r1 = 1;
@@ -1118,7 +1119,7 @@ describe('avrInstruction', () => {
it('should execute `WDR` instruction and call `cpu.onWatchdogReset`', () => {
loadProgram('WDR');
- cpu.onWatchdogReset = jest.fn();
+ cpu.onWatchdogReset = vi.fn();
expect(cpu.onWatchdogReset).not.toHaveBeenCalled();
avrInstruction(cpu);
expect(cpu.onWatchdogReset).toHaveBeenCalled();
diff --git a/src/cpu/interrupt.spec.ts b/src/cpu/interrupt.spec.ts
index c64724d..944dbb9 100644
--- a/src/cpu/interrupt.spec.ts
+++ b/src/cpu/interrupt.spec.ts
@@ -1,3 +1,4 @@
+import { describe, expect, it } from 'vitest';
import { CPU } from './cpu';
import { avrInterrupt } from './interrupt';
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.