From 4d25656f0d07a2eba290c048ce153abfd4257166 Mon Sep 17 00:00:00 2001 From: npmrun <1549469775@qq.com> Date: Mon, 27 Apr 2026 00:25:03 +0800 Subject: [PATCH] fix(test): add missing pixi Graphics mock for transition tests Made-with: Cursor --- tests/kernel/transition-transaction.test.ts | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/kernel/transition-transaction.test.ts b/tests/kernel/transition-transaction.test.ts index 8d6652d..06316fc 100644 --- a/tests/kernel/transition-transaction.test.ts +++ b/tests/kernel/transition-transaction.test.ts @@ -26,8 +26,48 @@ class MockContainer { } } +class MockGraphics extends MockContainer { + clear(): this { + return this; + } + + rect(): this { + return this; + } + + roundRect(): this { + return this; + } + + fill(): this { + return this; + } + + stroke(): this { + return this; + } +} + +class MockText extends MockContainer { + text = ""; + style: unknown; + anchor = { + set: () => {}, + }; + position = { + set: () => {}, + }; +} + +class MockTextStyle { + constructor(_style?: Record) {} +} + vi.mock("pixi.js", () => ({ Container: MockContainer, + Graphics: MockGraphics, + Text: MockText, + TextStyle: MockTextStyle, })); vi.mock("@/core/Game", () => {