mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-20 23:32:19 +02:00
Use vi function mocks
This commit is contained in:
parent
e93e366d93
commit
fe4cec8197
@ -52,9 +52,8 @@ export default class MockContainer implements MockGameObject {
|
|||||||
/// Sets the position of this Game Object to be a relative position from the source Game Object.
|
/// Sets the position of this Game Object to be a relative position from the source Game Object.
|
||||||
}
|
}
|
||||||
|
|
||||||
setInteractive(hitArea?, callback?, dropZone?) {
|
setInteractive = vi.fn();
|
||||||
/// Sets the InteractiveObject to be a drop zone for a drag and drop operation.
|
|
||||||
}
|
|
||||||
setOrigin(x, y) {
|
setOrigin(x, y) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { MockGameObject } from "../mockGameObject";
|
import { MockGameObject } from "../mockGameObject";
|
||||||
|
import { vi } from "vitest";
|
||||||
import Sprite = Phaser.GameObjects.Sprite;
|
import Sprite = Phaser.GameObjects.Sprite;
|
||||||
import Frame = Phaser.Textures.Frame;
|
import Frame = Phaser.Textures.Frame;
|
||||||
|
|
||||||
@ -101,9 +102,7 @@ export default class MockSprite implements MockGameObject {
|
|||||||
return this.phaserSprite.stop();
|
return this.phaserSprite.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
setInteractive(hitArea, hitAreaCallback, dropZone) {
|
setInteractive = vi.fn();
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
on(event, callback, source) {
|
on(event, callback, source) {
|
||||||
return this.phaserSprite.on(event, callback, source);
|
return this.phaserSprite.on(event, callback, source);
|
||||||
|
@ -197,9 +197,7 @@ export default class MockText implements MockGameObject {
|
|||||||
this.color = color;
|
this.color = color;
|
||||||
});
|
});
|
||||||
|
|
||||||
setInteractive(hitArea, hitAreaCallback, dropZone) {
|
setInteractive = vi.fn();
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
setShadowColor(color) {
|
setShadowColor(color) {
|
||||||
// Sets the shadow color.
|
// Sets the shadow color.
|
||||||
|
Loading…
Reference in New Issue
Block a user