import { Species } from "#app/enums/species.js"; import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; import GameManager from "../utils/gameManager"; describe("Spec - Pokemon", () => { let phaserGame: Phaser.Game; let game: GameManager; beforeAll(() => { phaserGame = new Phaser.Game({ type: Phaser.HEADLESS, }); }); afterEach(() => { game.phaseInterceptor.restoreOg(); }); beforeEach(() => { game = new GameManager(phaserGame); }); it("should not crash when trying to set status of undefined", async () => { await game.classicMode.runToSummon([Species.ABRA]); const pkm = game.scene.getPlayerPokemon()!; expect(pkm).toBeDefined(); expect(pkm.trySetStatus(undefined)).toBe(true); }); });