mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-03-09 03:18:24 +00:00
* move test folder * Update vitest files * rename test/utils to test/testUtils * Remove stray utils/gameManager Got put back from a rebase
44 lines
1.0 KiB
TypeScript
44 lines
1.0 KiB
TypeScript
import type MockTextureManager from "#test/testUtils/mocks/mockTextureManager";
|
|
import type { MockGameObject } from "../mockGameObject";
|
|
|
|
|
|
/**
|
|
* Stub for Phaser.Textures.Texture object
|
|
* Just mocks the function calls and data required for use in tests
|
|
*/
|
|
export default class MockTexture implements MockGameObject {
|
|
public manager: MockTextureManager;
|
|
public key: string;
|
|
public source;
|
|
public frames: object;
|
|
public firstFrame: string;
|
|
public name: string;
|
|
|
|
constructor(manager, key: string, source) {
|
|
this.manager = manager;
|
|
this.key = key;
|
|
this.source = source;
|
|
|
|
const mockFrame = {
|
|
width: 100,
|
|
height: 100,
|
|
cutX: 0,
|
|
cutY: 0
|
|
};
|
|
this.frames = {
|
|
firstFrame: mockFrame,
|
|
0: mockFrame,
|
|
1: mockFrame,
|
|
2: mockFrame,
|
|
3: mockFrame,
|
|
4: mockFrame
|
|
};
|
|
this.firstFrame = "firstFrame";
|
|
}
|
|
|
|
/** Mocks the function call that gets an HTMLImageElement, see {@link Pokemon.updateFusionPalette} */
|
|
getSourceImage() {
|
|
return null;
|
|
}
|
|
}
|