pokerogue/test/moves/miracle_eye.test.ts
Sirz Benjie a51a504155
[Test] Move test folder out of src (#5398)
* move test folder

* Update vitest files

* rename test/utils to test/testUtils

* Remove stray utils/gameManager

Got put back from a rebase
2025-02-22 22:52:07 -06:00

52 lines
1.5 KiB
TypeScript

import { BattlerIndex } from "#app/battle";
import { Moves } from "#app/enums/moves";
import { Species } from "#app/enums/species";
import { MoveEffectPhase } from "#app/phases/move-effect-phase";
import GameManager from "#test/testUtils/gameManager";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Moves - Miracle Eye", () => {
let phaserGame: Phaser.Game;
let game: GameManager;
beforeAll(() => {
phaserGame = new Phaser.Game({
type: Phaser.HEADLESS,
});
});
afterEach(() => {
game.phaseInterceptor.restoreOg();
});
beforeEach(() => {
game = new GameManager(phaserGame);
game.override
.disableCrits()
.enemySpecies(Species.UMBREON)
.enemyMoveset(Moves.SPLASH)
.enemyLevel(5)
.starterSpecies(Species.MAGIKARP)
.moveset([ Moves.MIRACLE_EYE, Moves.CONFUSION ]);
});
it("should allow Psychic moves to hit Dark types", async () => {
await game.classicMode.startBattle();
const enemy = game.scene.getEnemyPokemon()!;
game.move.select(Moves.CONFUSION);
await game.toNextTurn();
expect(enemy.hp).toBe(enemy.getMaxHp());
game.move.select(Moves.MIRACLE_EYE);
await game.toNextTurn();
game.move.select(Moves.CONFUSION);
await game.setTurnOrder([ BattlerIndex.PLAYER, BattlerIndex.ENEMY ]);
await game.phaseInterceptor.to(MoveEffectPhase);
expect(enemy.hp).toBeLessThan(enemy.getMaxHp());
});
});