mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-10-04 12:17:11 +02:00
* 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...
28 lines
720 B
TypeScript
28 lines
720 B
TypeScript
import { LoadingScene } from "#app/loading-scene.js";
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
|
import GameManager from "./utils/gameManager";
|
|
|
|
describe("BattleScene", () => {
|
|
let phaserGame: Phaser.Game;
|
|
let game: GameManager;
|
|
|
|
beforeAll(() => {
|
|
phaserGame = new Phaser.Game({
|
|
type: Phaser.HEADLESS,
|
|
});
|
|
});
|
|
|
|
beforeEach(() => {
|
|
game = new GameManager(phaserGame);
|
|
});
|
|
|
|
afterEach(() => {
|
|
game.phaseInterceptor.restoreOg();
|
|
});
|
|
|
|
it("should remove LoadingScene on create", () => {
|
|
// `BattleScene.create()` is called during the `new GameManager()` call
|
|
expect(game.scene.scene.remove).toHaveBeenCalledWith(LoadingScene.KEY);
|
|
});
|
|
});
|