Browse Source

fix(test): add missing pixi Graphics mock for transition tests

Made-with: Cursor
master
npmrun 2 weeks ago
parent
commit
4d25656f0d
  1. 40
      tests/kernel/transition-transaction.test.ts

40
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<string, unknown>) {}
}
vi.mock("pixi.js", () => ({ vi.mock("pixi.js", () => ({
Container: MockContainer, Container: MockContainer,
Graphics: MockGraphics,
Text: MockText,
TextStyle: MockTextStyle,
})); }));
vi.mock("@/core/Game", () => { vi.mock("@/core/Game", () => {

Loading…
Cancel
Save