mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-06 23:49:26 +02:00
* Standardize filenames to kebab-case Co-authored-by: pymilkmaiden <cassiopeiamahler56@gmail.com> * Move script outside of public folder * Move update_exp_sprites to scripts * Add ls-lint to lint file and directory names * Update lefthook.yml to skip merge / rebase on all pre-commit commands --------- Co-authored-by: pymilkmaiden <cassiopeiamahler56@gmail.com>
36 lines
907 B
TypeScript
36 lines
907 B
TypeScript
import { LoadingScene } from "#app/loading-scene";
|
|
import { GameManager } from "#test/test-utils/game-manager";
|
|
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
|
|
|
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);
|
|
});
|
|
|
|
it("should also reset RNG on reset", () => {
|
|
vi.spyOn(game.scene, "resetSeed");
|
|
|
|
game.scene.reset();
|
|
|
|
expect(game.scene.resetSeed).toHaveBeenCalled();
|
|
});
|
|
});
|