mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-10-20 20:15:50 +02:00
* Consolidate `doSelectTarget()` into `doAttack()` * Fix ternary * Add error message to aid in debugging tests * Update docs * [Test] Change `doAttack()` to `selectMove()` * Add `select()` to `src/test/utils/helpers/moveHelper.ts` * Replace instances of `game.selectMove()` with `game.move.select()` * Fix imports * Replace `selectMove()` with `move.select()` helper Fix broken tests for Pastel Veil and Sweet Veil * Update tsdocs
28 lines
717 B
TypeScript
28 lines
717 B
TypeScript
import { LoadingScene } from "#app/loading-scene";
|
|
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);
|
|
});
|
|
});
|