pokerogue/src/test/utils/mocks/mockGameObjectCreator.ts
flx-sta 29aa1a68e7
[Optimization] Destroy LoadingScene when done (after beta rebase) (#3215)
* destroy loading-scene when done

- unused event listeners are shut off
- children are removed
- `loading_bg` will be removed after transition is finished
- Added some simple types for `rex` plugins

* fix tests

* fix pokemonSprite.test.ts

on local runs it would include hidden dirs like `.DS_store`. Any files starting with `.` is now excluded

* add `mockGameObjectCreator` and use in `gameWrapper`

* add battle-scene.test.ts

add test to verify that LoadingScene is being removed on `BatleScene.create()` call

* update types usage for phaser3-rex-plugins

* remove phaser-extensions.d.ts

fk you typedoc...
2024-07-30 00:28:43 -04:00

24 lines
590 B
TypeScript

import { vi } from "vitest";
import MockGraphics from "./mocksContainer/mockGraphics";
import MockTextureManager from "./mockTextureManager";
export class MockGameObjectCreator {
private readonly textureManager: MockTextureManager;
constructor(textureManager: MockTextureManager) {
console.log("Mocking Phaser.GameObjects.GameObjectCreator;");
this.textureManager = textureManager;
}
graphics(config: any) {
return new MockGraphics(this.textureManager, config);
}
rexTransitionImagePack() {
return {
transit: vi.fn(),
once: vi.fn(),
};
}
}