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. /// 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;

View File

@ -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);

View File

@ -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.