pokerogue/src/test/moves/lash_out.test.ts
NightKev 11d912bad8
[Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062)
* Make `OPP_MOVESET_OVERRIDE` fully override the enemy's moveset

* Update tests with new override behavior

* Fix tests

* Fix another test

* Move overrides no longer required to be arrays

* Remove `SPLASH_ONLY` test utility variable

* Update moveset override helper functions

* Missed some tests
2024-09-09 12:55:11 -04:00

53 lines
1.5 KiB
TypeScript

import { BattlerIndex } from "#app/battle";
import { allMoves } from "#app/data/move";
import { Abilities } from "#app/enums/abilities";
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import GameManager from "#test/utils/gameManager";
import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
const TIMEOUT = 20 * 1000;
describe("Moves - Lash Out", () => {
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
.battleType("single")
.disableCrits()
.enemySpecies(Species.MAGIKARP)
.enemyAbility(Abilities.FUR_COAT)
.enemyMoveset([Moves.GROWL])
.startingLevel(10)
.enemyLevel(10)
.starterSpecies(Species.FEEBAS)
.ability(Abilities.BALL_FETCH)
.moveset([Moves.LASH_OUT]);
});
it("should deal double damage if the user's stat stages were lowered this turn", async () => {
vi.spyOn(allMoves[Moves.LASH_OUT], "calculateBattlePower");
await game.classicMode.startBattle();
game.move.select(Moves.LASH_OUT);
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]);
await game.phaseInterceptor.to("BerryPhase");
expect(allMoves[Moves.LASH_OUT].calculateBattlePower).toHaveReturnedWith(150);
}, TIMEOUT);
});