Use vi function mocks

This commit is contained in:
Brandon Bay 2024-09-06 10:28:00 -04:00
parent e93e366d93
commit fe4cec8197
3 changed files with 5 additions and 9 deletions

View File

@ -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.
}
setInteractive(hitArea?, callback?, dropZone?) {
/// Sets the InteractiveObject to be a drop zone for a drag and drop operation.
}
setInteractive = vi.fn();
setOrigin(x, y) {
this.x = x;
this.y = y;

View File

@ -1,5 +1,6 @@
import Phaser from "phaser";
import { MockGameObject } from "../mockGameObject";
import { vi } from "vitest";
import Sprite = Phaser.GameObjects.Sprite;
import Frame = Phaser.Textures.Frame;
@ -101,9 +102,7 @@ export default class MockSprite implements MockGameObject {
return this.phaserSprite.stop();
}
setInteractive(hitArea, hitAreaCallback, dropZone) {
return null;
}
setInteractive = vi.fn();
on(event, callback, source) {
return this.phaserSprite.on(event, callback, source);

View File

@ -197,9 +197,7 @@ export default class MockText implements MockGameObject {
this.color = color;
});
setInteractive(hitArea, hitAreaCallback, dropZone) {
return null;
}
setInteractive = vi.fn();
setShadowColor(color) {
// Sets the shadow color.