mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 00:52:47 +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
32 lines
778 B
TypeScript
32 lines
778 B
TypeScript
import { Species } from "#app/enums/species";
|
|
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);
|
|
});
|
|
});
|